Skip to content

Commit 8b48f70

Browse files
committed
修复Read错误
1 parent 7124610 commit 8b48f70

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/KoalaWiki/Agents/AgentFactory.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ public static ChatClientAgent CreateChatClientAgentAsync(string modelId,
1717
{
1818
var openAIClient = new OpenAIClient(new ApiKeyCredential(OpenAIOptions.ChatApiKey), new OpenAIClientOptions
1919
{
20-
Endpoint = new Uri(OpenAIOptions.Endpoint) // 您的自定义端点
20+
Endpoint = new Uri(OpenAIOptions.Endpoint),
2121
});
2222

2323
var chatClient = openAIClient.GetChatClient(modelId);
2424

25-
var agentOptions = new ChatClientAgentOptions();
26-
agentOptions.ChatMessageStoreFactory = (messageContext) =>
25+
var agentOptions = new ChatClientAgentOptions
2726
{
28-
var logger = loggerFactory?.CreateLogger<AutoContextCompress>();
29-
return new AutoContextCompress(messageContext, chatClient.AsIChatClient(), logger);
27+
ChatMessageStoreFactory = (messageContext) =>
28+
{
29+
var logger = loggerFactory?.CreateLogger<AutoContextCompress>();
30+
return new AutoContextCompress(messageContext, chatClient.AsIChatClient(), logger);
31+
},
3032
};
3133
agentAction.Invoke(agentOptions);
3234

src/KoalaWiki/KoalaWarehouse/DocumentPending/DocumentPendingService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ await dbContext.DocumentCatalogs.Where(x => x.Id == catalog.Id)
165165
new Microsoft.Extensions.AI.TextContent(prompt),
166166
new Microsoft.Extensions.AI.TextContent(
167167
$"""
168-
```xml
169168
<system-reminder>
170169
For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
171170
Note: The repository's directory structure has been provided in <code_files>. Please utilize the provided structure directly for file navigation and reading operations, rather than relying on glob patterns or filesystem traversal methods.

src/KoalaWiki/Tools/FileTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public AITool Create()
5858
{
5959
return AIFunctionFactory.Create(ReadFileFromLineAsync, new AIFunctionFactoryOptions()
6060
{
61-
Name = "Read"
61+
Name = "ReadFile"
6262
});
6363
}
6464

0 commit comments

Comments
 (0)