MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_openai_convert_messages_tool_result

Function test_openai_convert_messages_tool_result

core/src/llm/tests.rs:935–944  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

933
934 #[test]
935 fn test_openai_convert_messages_tool_result() {
936 let client = OpenAiClient::new("key".to_string(), "gpt-4".to_string());
937 let msgs = vec![Message::tool_result("call-1", "output data", false)];
938 let converted = client.convert_messages(&msgs);
939
940 assert_eq!(converted.len(), 1);
941 assert_eq!(converted[0]["role"], "tool");
942 assert_eq!(converted[0]["tool_call_id"], "call-1");
943 assert_eq!(converted[0]["content"], "output data");
944 }
945
946 #[test]
947 fn test_openai_convert_messages_assistant_with_tool_calls() {

Callers

nothing calls this directly

Calls 1

convert_messagesMethod · 0.80

Tested by

no test coverage detected