siddeshwar-kagatikar commited on
Commit
8ceabd3
·
1 Parent(s): 1166e01

hugging face

Browse files
Files changed (1) hide show
  1. tests/test_inference.py +11 -1
tests/test_inference.py CHANGED
@@ -1,4 +1,4 @@
1
- from inference import _looks_like_placeholder_api_key, _tool_result_message
2
 
3
 
4
  def test_placeholder_api_key_detection():
@@ -25,3 +25,13 @@ def test_tool_result_message_reuses_assistant_tool_call_id():
25
  assert tool_message is not None
26
  assert tool_message["tool_call_id"] == "call_123"
27
  assert tool_message["role"] == "tool"
 
 
 
 
 
 
 
 
 
 
 
1
+ from inference import _format_action, _looks_like_placeholder_api_key, _tool_result_message
2
 
3
 
4
  def test_placeholder_api_key_detection():
 
25
  assert tool_message is not None
26
  assert tool_message["tool_call_id"] == "call_123"
27
  assert tool_message["role"] == "tool"
28
+
29
+
30
+ def test_action_formatter_matches_single_line_style():
31
+ assert _format_action({"action_type": "ANSWER", "payload": {"answer": "user_bharat"}}) == "answer(user_bharat)"
32
+ assert _format_action(
33
+ {
34
+ "action_type": "CALL_TOOL",
35
+ "payload": {"tool_name": "get_post", "args": {"post_id": "post_midnight_manifest"}},
36
+ }
37
+ ) == "get_post(post_id=post_midnight_manifest)"