Closed
Description
Describe the bug
Framework: Microsoft Semantic Kernel 1.49.0
I am testing ChatCompletionAgent with a locally deployed llama3.2:3b to query a knowledge base with data in Chinese via a text search plugin. When a user asks a question in Chinese, the agent can invoke the text search plugin, but with a garbled Chinese text, causing the search to fail. Please see the screenshot below:
Screenshots
I attach part of my code below:
kernelBuilder.Services.AddOllamaChatCompletion(
modelId: LLMConfig.Instance.ConfigModel.ModelId,
endpoint: new Uri(LLMConfig.Instance.ConfigModel.ApiEndpoint)
);
var textEmbeddingGeneration = vectorStoreFixture.TextEmbeddingGenerationService;
var vectorSearch = vectorStoreFixture.VectorStoreRecordCollection;
var customVectorSearch = new CustomVectorSearch(vectorSearch, threshold);
// Create a text search instance using the InMemory vector store.
var textSearch = new VectorStoreTextSearch<VectorRecordModel>(
customVectorSearch,
textEmbeddingGeneration);
var searchPlugin = KernelPluginFactory.CreateFromFunctions(
pluginName, description,
[textSearch.CreateGetTextSearchResults(searchOptions: searchOptions)]);
kernel.Plugins.Add(searchPlugin);
var kernel = kernelBuilder.Build();
ChatCompletionAgent faqAgent =
new()
{
Name = "SearchFAQAgent",
Instructions = LLMConfig.Instance.ConfigModel.Instructions,
Kernel = kernel,
Arguments =
new KernelArguments(new OllamaPromptExecutionSettings()
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
})
};
`
Platform
- Language: [C#]
- AI model: [llama3.2:3b]
- IDE: [Visual Studio]
- OS: [Windows]
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Sprint: Done