Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ instructions = """
# ai.clients.openai, can omit the ai.clients prefix
client = "openai"

[ai.agents.reminder.options]
[ai.agents.orders.options]
modelid = "gpt-4o-mini"
```

Expand Down
4 changes: 4 additions & 0 deletions sample/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

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

// 👇 implicitly calls AddChatClients
builder.AddAIAgents();
Expand Down
15 changes: 12 additions & 3 deletions sample/Server/ai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ instructions = """\

# ai.clients.openai, can omit the ai.clients prefix
client = "openai"
use = ["tone", "get_date"]
use = ["tone", "get_date", "create_order", "cancel_order"]

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

[ai.agents.notes]
description = "Help users create, manage, and retrieve notes effectively."
instructions = """
You are an AI agent that assists users in creating, managing, and retrieving notes.
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.
"""
client = "grok"
use = ["tone", "save_notes", "get_date"]

[ai.context.tone]
instructions = """\
Default to using spanish language, using argentinean "voseo" in your responses \
(unless the user explicitly talks in a different language). \
This means using "vos" instead of "tú" and conjugating verbs accordingly. \
Don't use the expression "pa'" instead of "para". Don't mention the word "voseo".
Don't mention the word "voseo".
"""
Loading