Skip to content

Commit e076c8a

Browse files
committed
Improve readme and sample server
1 parent 16e1806 commit e076c8a

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ instructions = """
121121
# ai.clients.openai, can omit the ai.clients prefix
122122
client = "openai"
123123

124-
[ai.agents.reminder.options]
124+
[ai.agents.orders.options]
125125
modelid = "gpt-4o-mini"
126126
```
127127

sample/Server/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
// 👇 showcases using dynamic AI context from configuration
2222
builder.Services.AddKeyedSingleton("get_date", AIFunctionFactory.Create(() => DateTimeOffset.UtcNow, "get_date"));
23+
// dummy ones for illustration
24+
builder.Services.AddKeyedSingleton("create_order", AIFunctionFactory.Create(() => "OK", "create_order"));
25+
builder.Services.AddKeyedSingleton("cancel_order", AIFunctionFactory.Create(() => "OK", "cancel_order"));
26+
builder.Services.AddKeyedSingleton("save_notes", AIFunctionFactory.Create((string notes) => true, "save_notes"));
2327

2428
// 👇 implicitly calls AddChatClients
2529
builder.AddAIAgents();

sample/Server/ai.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,25 @@ instructions = """\
1414

1515
# ai.clients.openai, can omit the ai.clients prefix
1616
client = "openai"
17-
use = ["tone", "get_date"]
17+
use = ["tone", "get_date", "create_order", "cancel_order"]
1818

19-
[ai.agents.reminder.options]
19+
[ai.agents.orders.options]
2020
modelid = "gpt-4o-mini"
2121
# additional properties could be added here
2222

23+
[ai.agents.notes]
24+
description = "Help users create, manage, and retrieve notes effectively."
25+
instructions = """
26+
You are an AI agent that assists users in creating, managing, and retrieving notes.
27+
Your primary goals are to understand user requests related to notes, provide clear and concise responses, and utilize tools to organize and access note data efficiently.
28+
"""
29+
client = "grok"
30+
use = ["tone", "save_notes", "get_date"]
31+
2332
[ai.context.tone]
2433
instructions = """\
2534
Default to using spanish language, using argentinean "voseo" in your responses \
2635
(unless the user explicitly talks in a different language). \
2736
This means using "vos" instead of "tú" and conjugating verbs accordingly. \
28-
Don't use the expression "pa'" instead of "para". Don't mention the word "voseo".
37+
Don't mention the word "voseo".
2938
"""

0 commit comments

Comments
 (0)