Repository navigation
Unit Testing with Semantic Kernel #8088
|
Hi team, Here the AI response is a simple string and that code path is covered by the test. Could you let me know how can i pass the funtion to be called in the mock? |
Replies: 1 comment 1 reply
|
you can mock at the HHTP level to control the response. Here is an example (for Mistral AI): https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.MistralAI.UnitTests/Client/MistralClientTests.cs#L168 Here are the sample responses: https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.MistralAI.UnitTests/TestData |
Hi Manish Reddy (@Manish-22)
you can mock at the HHTP level to control the response.
Here is an example (for Mistral AI): https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.MistralAI.UnitTests/Client/MistralClientTests.cs#L168
Here are the sample responses: https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors/Connectors.MistralAI.UnitTests/TestData