Skip to content

Commit d480c52

Browse files
committed
[AI Bundle] Update documentation for new system_prompt configuration structure
- Update advanced example to use new nested format - Add comprehensive documentation section explaining both configuration formats - Document simple string format for basic usage - Document advanced array format with include_tools option - Provide clear examples and configuration options reference
1 parent 77ecb40 commit d480c52

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

src/ai-bundle/doc/index.rst

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ Configuration
7171
model:
7272
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
7373
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
74-
system_prompt: 'You are a helpful assistant that can answer questions.' # The default system prompt of the agent
75-
include_tools: true # Include tool definitions at the end of the system prompt
74+
system_prompt: # The system prompt configuration
75+
prompt: 'You are a helpful assistant that can answer questions.' # The prompt text
76+
include_tools: true # Include tool definitions at the end of the system prompt
7677
tools:
7778
# Referencing a service with #[AsTool] attribute
7879
- 'Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch'
@@ -144,6 +145,46 @@ Configuration
144145
vectorizer: 'ai.vectorizer.mistral_embeddings'
145146
store: 'ai.store.memory.research'
146147
148+
System Prompt Configuration
149+
----------------------------
150+
151+
The ``system_prompt`` configuration supports two formats to provide flexibility for different use cases:
152+
153+
**Simple Format (String)**
154+
155+
For basic usage when you only need to set a prompt text:
156+
157+
.. code-block:: yaml
158+
159+
ai:
160+
agent:
161+
my_agent:
162+
model:
163+
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
164+
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
165+
system_prompt: 'You are a helpful assistant.'
166+
167+
**Advanced Format (Array)**
168+
169+
For advanced usage when you need additional configuration like tool inclusion:
170+
171+
.. code-block:: yaml
172+
173+
ai:
174+
agent:
175+
my_agent:
176+
model:
177+
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
178+
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
179+
system_prompt:
180+
prompt: 'You are a helpful assistant that can answer questions.'
181+
include_tools: true # Include tool definitions at the end of the system prompt
182+
183+
**Configuration Options**
184+
185+
* ``prompt`` (string): The system prompt text that will be sent to the AI model
186+
* ``include_tools`` (boolean, default: false): Whether to automatically append tool definitions to the system prompt
187+
147188
Usage
148189
-----
149190

0 commit comments

Comments
 (0)