Created
May 17, 2025 11:02
-
-
Save pavlovmilen/8ea7bd77db8fdeb3b666b2b9980df204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az_client = AsyncOpenAI( | |
api_key=os.environ.get("AZURE_OPEN_AI_API_KEY_SWEDEN"), # Use your OpenAI API key | |
base_url=os.environ.get("AZURE_OPEN_AI_API_ENDPOINT_SWEDEN"), | |
) | |
gpt_model_client = AzureOpenAIChatCompletionClient( | |
model="gpt-4.1-mini-2025-04-14", | |
api_version="2024-06-01", | |
azure_deployment="gpt-4.1-mini", | |
azure_endpoint=os.environ.get("AZURE_OPEN_AI_API_ENDPOINT_SWEDEN"), | |
#azure_ad_token_provider=token_provider, # Optional if you choose key-based authentication. | |
api_key=os.environ.get("AZURE_OPEN_AI_API_KEY_SWEDEN"), | |
) | |
my_app_info_agent = OpenAIAssistantAgent( | |
name="app_info_agent", | |
description="An agent for getting my app info", | |
client=az_client, | |
model="gpt-4o-2024-08-06", | |
instructions=""" | |
You are a my app info agent that can answer questions about my app and how to troubleshoot it. | |
""", | |
tools=[get_my_app_info] | |
) | |
my_app_agents_team = SelectorGroupChat( | |
[planning_agent, my_app_info_agent, my_app_health_check_agent], | |
termination_condition=termination, | |
allow_repeated_speaker=True, | |
model_client=gpt_model_client, | |
selector_prompt=selector_prompt) | |
runtime.start() | |
message_count = 0 | |
#prompts | |
async for message in my_app_agents_team.run_stream(task="How can I check if myapp dev environment is working? Use PlanningAgent to create an action plan first."): | |
if isinstance(message, TaskResult): | |
print("Stop Reason:", message.stop_reason) | |
...... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment