77from pydantic_ai import Agent
88from pydantic_ai .common_tools .tavily import tavily_search_tool
99from pydantic_ai .messages import ModelMessage , ModelResponse , ThinkingPart
10+ from pydantic_ai .settings import ModelSettings
1011
1112from assistant .core .models import ModelFactory
1213from assistant .core .schemas import Deps , ExperimentDefinition , OrchestrationResult , RouterOutput
@@ -71,6 +72,7 @@ def _create_experiment_creator_agent(self) -> Agent[Deps, ExperimentDefinition]:
7172 instructions = load_prompt ("experiment_creator_instructions.md" ).render (),
7273 output_type = ExperimentDefinition ,
7374 deps_type = Deps ,
75+ model_settings = ModelSettings (max_tokens = 10_000 ),
7476 tools = [
7577 retrieve_metrics_docs ,
7678 ],
@@ -89,6 +91,7 @@ def _create_internal_database_agent(self) -> Agent[Deps, str]:
8991 instructions = load_prompt ("sql_expert_instructions.md" ).render (),
9092 output_type = str ,
9193 deps_type = Deps ,
94+ model_settings = ModelSettings (max_tokens = 10_000 ),
9295 tools = [
9396 retrieve_internal_db ,
9497 ],
@@ -108,6 +111,7 @@ def _create_experiment_analyst_agent(self) -> Agent[Deps, str]:
108111 instructions = load_prompt ("experiment_analyst_instructions.md" ).render (),
109112 output_type = str ,
110113 deps_type = Deps ,
114+ model_settings = ModelSettings (max_tokens = 20_000 ),
111115 tools = [
112116 get_expanto_app_context ,
113117 ],
@@ -127,6 +131,7 @@ def _create_internet_search_agent(self) -> Agent[Deps, str]:
127131 instructions = load_prompt ("internet_search_instructions.md" ).render (),
128132 output_type = str ,
129133 deps_type = Deps ,
134+ model_settings = ModelSettings (max_tokens = 10_000 ),
130135 tools = [tavily_search_tool (self .tavily_api_key )],
131136 )
132137
@@ -139,6 +144,7 @@ def _create_expanto_assistant(self) -> Agent[Deps, str]:
139144 instructions = "Use as many tool call as you needed" ,
140145 output_type = str ,
141146 deps_type = Deps ,
147+ model_settings = ModelSettings (max_tokens = 10_000 ),
142148 tools = [
143149 retrieve_relevant_docs ,
144150 retrieve_codebase_docs ,
@@ -160,6 +166,7 @@ def _create_universal_agent(self) -> Agent[Deps, str]:
160166 "Use any tools if you need to answer user question or execute user task" ,
161167 output_type = str ,
162168 deps_type = Deps ,
169+ model_settings = ModelSettings (max_tokens = 10_000 ),
163170 tools = [
164171 retrieve_metrics_docs ,
165172 retrieve_relevant_docs ,
0 commit comments