Skip to content

Conversation

@MaryanneNjeri
Copy link
Contributor

@MaryanneNjeri MaryanneNjeri commented Dec 6, 2025

This PR

Adds the AI agent sample console app, that we will include in the AI Agent configuration doc. The agent is created declaratively check out creating agents declaratively for more information.

Sample yaml agent spec used for this sample

        kind: Prompt
        name: WeatherAgent
        description: Weather Agent
        instructions: You are a helpful assistant.
        model:
            id: gpt-4.1
            connection:
                kind: remote

In the future we will build on this sample and include tool configuration to show case dynamic configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be binary file? GitHub can't load it for review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No its a txt file not sure why the diff isn't able to load the file but in GitHub the file is visible
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. Something wrong with its encoding. I tried in different browsers and also asked someone else to try with no luck.

Copy link
Contributor Author

@MaryanneNjeri MaryanneNjeri Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right , I've updated the file encoding and it should now be visible in the diff

kind: remote
```

1. Configure your Azure App Configuration store with project endpoint:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to add a key-value in appconfig store? The instruction is unclear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updated instructions to be more clearer, please let me know if its better, also as part of the preq should we include instructions on how to create a project and deploy a model in Foundry ?

Copy link
Member

@zhenlan zhenlan Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about put it under examples/Python/WeatherAgent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is better, this has been updated, thanks

AgentFactory(client_kwargs={"async_credential": credential, "project_endpoint": config["Agent:ProjectEndpoint"]}).create_agent_from_yaml(yaml_str) as agent,
):
while True:
print("How can I help? (type 'quit' to exit)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a weather agent, the question should be related to weather.

Copy link
Contributor Author

@MaryanneNjeri MaryanneNjeri Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the initial prompt ? Instead of "How can I help ?", maybe we can include some sample output in the read me something like this

How can I help? (type 'quit' to exit)
User: What is the weather in Seattle ?
Agent response:  I don’t have access to real-time data, but you can quickly check the current weather in Seattle
using a reliable source like [Weather.com](https://weather.com/weather/today/l/Seattle+WA) or your preferred weather app.

As a general overview, Seattle’s weather in early June is usually mild, with temperatures ranging from the mid-50s 
to upper 60s °F (about 13–20°C). Expect partly cloudy skies with occasional showers. 
If you need a weather forecast for a specific day or a longer period, let me know!
Press enter to continue...
How can I help? (type 'quit' to exit)
User: quit
Exiting... Goodbye...

Though because this agent has no tool configured its not able to give us real time weather data. Maybe we should update the agent yaml spec to include a tool like Bing search or openapi that gives the agent access to real time data? In this sample app we don't change any agent configuration and having a tool as part of the agent yaml spec can let users know that their tool configuration could also be part of the agent yaml spec.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your proposal is reasonable, so we don't tie us to a "weather" scenario. Then we don't have to call it a WeatherAgent, but simply a ChatAgent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and in the sample output, we can ask questions about real time data

pip install -r requirements.txt
```

1. Configure your Azure App Configuration store with the following key-value pairs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Configure your Azure App Configuration store with the following key-value pairs:
1. Add the following key-values to your Azure App Configuration store.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been updated, thanks

- Azure App Configuration service
- Microsoft Foundry project
- Required environment variables:
- `AZURE_APPCONFIGURATION_ENDPOINT`: Endpoint URL of your Azure App Configuration instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of your instructions, so it's not a prereq.

Copy link
Contributor Author

@MaryanneNjeri MaryanneNjeri Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhenlan I wanted to confirm as part of the preq should we include instructions or link to relevant docs on how to create a project, deploy a model in Foundry and create a bing resource or to ease the set up for a user we can have a script that sets up all the resources in Foundry ?

import asyncio
import os
from agent_framework.declarative import AgentFactory
from azure.identity.aio import DefaultAzureCredential as AsyncDefaultCredential
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why as AsyncDefaultCredential?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it causes a conflict, since on line 5 we still import DefaultAzureCredential in agent framework when constructing the AzureAIClient it expects async credentials to use for authentication (https://github.com/eavanvalkenburg/agent-framework/blob/0d9ae1920dea956856055770f71192ed6317f72d/python/packages/azure-ai/agent_framework_azure_ai/_client.py#L89) or if credential is not provided project_client should be provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants