Skip to content

Commit 71c2e4d

Browse files
committed
Fix
1 parent b30f8d8 commit 71c2e4d

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,19 @@ git clone https://github.com/Azure-Samples/get-started-with-ai-agents.git
5050
```
5151
At this point you could make changes to the code if required. However, no changes are needed to deploy and test the app as shown in the next step.
5252

53-
#### Configure your Agent (optional)
53+
#### How to configure Agent model and version
5454
<!-- TODO where do we want this? probably after downloading the code -->
55-
If you want to personalize your agent, you can change the default configuration for your agent. Additional details on changing your agent can be found in [customizing model deployments](docs/deploy_customization.md#customizing-model-deployments). For more information on the Azure OpenAI models and non-Microsoft models that can be used in your deployment, view the [list of models supported by Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/concepts/model-region-support).
55+
By default, the template uses model `gpt-4o-mini`, version `2024-07-18` for text generation and `text-embedding-3-small` version `1` for embeddings. If you want to personalize your agent, you can change the default configuration for your agent. Additional details on changing your agent can be found in [customizing model deployments](docs/deploy_customization.md#customizing-model-deployments). For more information on the Azure OpenAI models and non-Microsoft models that can be used in your deployment, view the [list of models supported by Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/concepts/model-region-support).
5656

5757
To specify the model (e.g. gpt-4o-mini, gpt-4o) that is deployed for the agent when `azd up` is called, set the following environment variables:
5858
```shell
5959
azd env set AZURE_AI_AGENT_MODEL_NAME <MODEL_NAME>
6060
azd env set AZURE_AI_AGENT_MODEL_VERSION <MODEL_VERSION>
6161
```
6262

63-
In this example an agent can perform search using the context given in the search index, deployed in Azure AI Search resource (default) or in the uploaded files. The semantic index search represents so-called hybrid search i.e. it uses LLM to search for the relevant context in the provided index as well as embedding similarity search. This index is built from the `embeddings.csv` file, containing the embeddings vectors, followed by the contexts.
64-
To use file search instead, please set the local environment variable `USE_SEARCH_SERVICE` to `false` during the `azd up` command. In this case the Azure AI Search resource will not be deployed.
63+
#### How to configure Agent knowledge retrieval
64+
By default, the template deploys OpenAI's file search for agent's knowledge retrieval. An agent also can perform search using the search index, deployed in Azure AI Search resource. The semantic index search represents so-called hybrid search i.e. it uses LLM to search for the relevant context in the provided index as well as embedding similarity search. This index is built from the `embeddings.csv` file, containing the embeddings vectors, followed by the contexts.
65+
To use index search, please set the local environment variable `USE_AZURE_AI_SEARCH_SERVICE` to `true` during the `azd up` command. In this case the Azure AI Search resource will be deployed and used.
6566

6667
#### Logging
6768
If you want to enable logging to a file, uncomment the following line in Dockerfile located in the src directory:

infra/main.parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"value": "${USE_APPLICATION_INSIGHTS=true}"
4949
},
5050
"useSearchService": {
51-
"value": "${USE_SEARCH_SERVICE=true}"
51+
"value": "${USE_AZURE_AI_SEARCH_SERVICE=false}"
5252
},
5353
"agentName": {
5454
"value": "${AZURE_AI_AGENT_NAME=agent-template-assistant}"

src/api/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async def get_result(thread_id: str, agent_id: str, ai_client : AIProjectClient)
125125
try:
126126
async with await ai_client.agents.create_stream(
127127
thread_id=thread_id,
128-
assistant_id=agent_id,
128+
agent_id=agent_id,
129129
event_handler=MyEventHandler(ai_client)
130130
) as stream:
131131
logger.info("Successfully created stream; starting to process events")

src/gunicorn.conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,26 +178,28 @@ async def get_available_toolset(
178178
async def create_agent(ai_client: AIProjectClient,
179179
creds: AsyncTokenCredential) -> Agent:
180180
logger.info("Creating new agent with resources")
181+
toolset = await get_available_toolset(ai_client, creds)
181182

182183
agent = await ai_client.agents.create_agent(
183184
model=os.environ["AZURE_AI_AGENT_DEPLOYMENT_NAME"],
184185
name=os.environ["AZURE_AI_AGENT_NAME"],
185186
instructions="You are helpful assistant",
186-
toolset=await get_available_toolset(ai_client, creds)
187+
toolset=toolset
187188
)
188189
return agent
189190

190191

191192
async def update_agent(agent: Agent, ai_client: AIProjectClient,
192193
creds: AsyncTokenCredential) -> Agent:
193194
logger.info("Updating agent with resources")
195+
toolset = await get_available_toolset(ai_client, creds)
194196

195197
agent = await ai_client.agents.update_agent(
196-
assistant_id=agent.id,
198+
agent_id=agent.id,
197199
model=os.environ["AZURE_AI_AGENT_DEPLOYMENT_NAME"],
198200
name=os.environ["AZURE_AI_AGENT_NAME"],
199201
instructions="You are helpful assistant",
200-
toolset=await get_available_toolset(ai_client, creds)
202+
toolset=toolset
201203
)
202204
return agent
203205

0 commit comments

Comments
 (0)