Skip to content

Commit 693f3ae

Browse files
committed
Add TOML example to readme
1 parent 7ea9164 commit 693f3ae

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

readme.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,42 @@ await foreach (AIAgent agent in catalog.GetAgentsAsync())
100100
}
101101
```
102102

103+
You can of course use any config format supported by .NET configuration, such as
104+
TOML which is arguably more human-friendly for hand-editing:
105+
106+
```toml
107+
[ai.clients.openai]
108+
modelid = "gpt-4.1"
109+
110+
[ai.clients.grok]
111+
endpoint = "https://api.x.ai/v1"
112+
modelid = "grok-4-fast-non-reasoning"
113+
114+
[ai.agents.orders]
115+
description = "Manage orders using catalogs for food or any other item."
116+
instructions = """
117+
118+
You are an AI agent responsible for processing orders for food or other items.
119+
Your primary goals are to identify user intent, extract or request provider information, manage order data using tools and friendly responses to guide users through the ordering process.
120+
121+
"""
122+
123+
# ai.clients.openai, can omit the ai.clients prefix
124+
client = "openai"
125+
126+
[ai.agents.reminder.options]
127+
modelid = "gpt-4o-mini"
128+
```
129+
130+
This can be used by leveraging [Tomlyn.Extensions.Configuration](https://www.nuget.org/packages/Tomlyn.Extensions.Configuration).
131+
132+
> [!NOTE]
133+
> This package will automatically dedent and trim start and end newlines from
134+
> multi-line instructions and descriptions when applying the configuration,
135+
> avoiding unnecessary tokens being used for indentation while allowing flexible
136+
> formatting in the config file.
137+
138+
103139
<!-- #agents -->
104140

105141
# Devlooped.Extensions.AI

0 commit comments

Comments
 (0)