File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
learn-pr/wwl-data-ai/develop-ai-agent-with-semantic-kernel/includes Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Here's the code that illustrates how to create an AzureAIAgent:
16
16
17
17
``` python
18
18
from azure.identity.aio import DefaultAzureCredential
19
- from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings
19
+ from semantic_kernel.agents import AzureAIAgent, AzureAIAgentThread, AzureAIAgentSettings
20
20
21
21
# Create an AzureAIAgentSettings object
22
22
ai_agent_settings = AzureAIAgentSettings.create()
@@ -43,11 +43,11 @@ async with (@
43
43
Once your agent is defined, you can create a thread to interact with your agent and invoke responses for inputs. For example:
44
44
45
45
``` python
46
- # Use the client agent service to create a thread
47
- thread = await client.agents.create_thread( )
46
+ # Create the agent thread
47
+ thread: AzureAIAgentThread = AzureAIAgentThread( client = client )
48
48
49
49
try :
50
- # Create prompts
50
+ # Create prompts
51
51
prompt_messages = [" What are the largest semiconductor manufacturing companies?" ]
52
52
53
53
# Invoke a response from the agent
57
57
print (response)
58
58
finally :
59
59
# Clean up the thread
60
- await client.agents.delete_thread( thread.id)
60
+ await thread.delete() if thread else None
61
61
```
62
62
63
63
### AzureAIAgent key components
You can’t perform that action at this time.
0 commit comments