38 references to FunctionResultContent
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
615return new FunctionResultContent(result.CallContent.CallId, result.CallContent.Name, functionResult) { Exception = result.Exception };
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatCompletionTests.cs (1)
252new FunctionResultContent("call123", "name", 42),
ChatCompletion\ChatMessageTests.cs (2)
132new FunctionResultContent("callId1", "fc2", "result"), 289new FunctionResultContent("function-id", "plugin-name-function-name", "function-result"),
ChatCompletion\StreamingChatCompletionUpdateTests.cs (1)
99new FunctionResultContent("callId1", "fc2", "result"),
Contents\FunctionResultContentTests.cs (5)
15FunctionResultContent c = new("callId1", "functionName", null); 27FunctionResultContent c = new("id", "name", "result"); 39FunctionResultContent c = new("callId1", "functionName", null); 69var sut = new FunctionResultContent("id", "p1-f1", "result"); 87var sut = new FunctionResultContent("callId1", "functionName", null) { Exception = new InvalidOperationException("hello") };
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
461new(ChatRole.Tool, [new FunctionResultContent("abcd1234", "GetPersonAge", 42)]),
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (2)
897new FunctionResultContent("12345", "SayHello", "Said hello"), 898new FunctionResultContent("12346", "SayHi", "Said hi"),
Microsoft.Extensions.AI.Tests (25)
ChatCompletion\FunctionInvokingChatClientTests.cs (24)
59new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 61new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 63new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 97new FunctionResultContent("callId1", "Func1", result: "Result 1"), 98new FunctionResultContent("callId2", "Func2", result: "Result 2: 34"), 99new FunctionResultContent("callId3", "Func2", result: "Result 2: 56"), 108new FunctionResultContent("callId4", "Func2", result: "Result 2: 78"), 109new FunctionResultContent("callId5", "Func1", result: "Result 1") 148new FunctionResultContent("callId1", "Func", result: "hellohello"), 149new FunctionResultContent("callId2", "Func", result: "worldworld"), 191new FunctionResultContent("callId1", "Func", result: "hellohello"), 192new FunctionResultContent("callId2", "Func", result: "worldworld"), 221new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 223new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 225new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 273new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func1", result: "Result 1")]), 275new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 277new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 296new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func1", result: "Result 1")]), 298new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 300new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 339new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: detailedErrors ? "Error: Function failed. Exception: Oh no!" : "Error: Function failed.")]), 398new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 454new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]),
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
103new(ChatRole.Tool, [new FunctionResultContent("12345", "GetPersonName", "John")]),