You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`model`: Model identifier (string) - see [model provider documentation](https://strandsagents.com/latest/user-guide/quickstart/#using-a-string-model-id)
64
+
-`model`: Model identifier (string) - [[Only supports AWS Bedrock model provider string](../../../quickstart/#using-a-string-model-id)]
65
65
-`prompt`: System prompt for the agent (string)
66
66
-`tools`: List of tool specifications (list of strings)
67
67
-`name`: Agent name (string)
@@ -100,12 +100,51 @@ The Agent class handles all tool loading internally, including:
The `model` property uses the [string based model id feature](../../../quickstart/#using-a-string-model-id). You can reference [AWS's Model Id's](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html) to identify a model id to use. If you want to use a different model provider, you can pass in a model as part of the `**kwargs` of the `config_to_agent` function:
106
+
107
+
```python
108
+
from strands.experimental import config_to_agent
109
+
from strands.models.openai import OpenAIModel
110
+
111
+
# Create agent from dictionary
112
+
agent = config_to_agent(
113
+
config={"name": "Data Analyst"},
114
+
model=OpenAIModel(
115
+
client_args={
116
+
"api_key": "<KEY>",
117
+
},
118
+
model_id="gpt-4o",
119
+
)
120
+
)
121
+
```
122
+
123
+
Additionally, you can override the `agent.model` attribute of an agent to configure a new model provider:
124
+
125
+
```python
126
+
from strands.experimental import config_to_agent
127
+
from strands.models.openai import OpenAIModel
128
+
129
+
# Create agent from dictionary
130
+
agent = config_to_agent(
131
+
config={"name": "Data Analyst"}
132
+
)
133
+
134
+
agent.model = OpenAIModel(
135
+
client_args={
136
+
"api_key": "<KEY>",
137
+
},
138
+
model_id="gpt-4o",
139
+
)
140
+
```
141
+
103
142
## Function Parameters
104
143
105
144
The `config_to_agent` function accepts:
106
145
107
146
-`config`: Either a file path (string) or configuration dictionary
108
-
-`**kwargs`: Additional [Agent constructor parameters](https://strandsagents.com/latest/api-reference/agent/#strands.agent.agent.Agent.__init__) that override config values
147
+
-`**kwargs`: Additional [Agent constructor parameters](../../../../api-reference/agent/#strands.agent.agent.Agent.__init__) that override config values
109
148
110
149
```python
111
150
# Override config values with valid Agent parameters
0 commit comments