Python: fix string parsing in azure openai client (#1023)

* fix string parsing in azure openai client

* test fix

* changed setup func name and check if there is a conn string

* redid parsing in safe way
This commit is contained in:
Eduard van Valkenburg
2025-09-30 21:33:12 +02:00
committed by GitHub
Unverified
parent f7e9490494
commit 3eb26632ce
9 changed files with 33 additions and 26 deletions
@@ -38,7 +38,7 @@ async def main() -> None:
AzureAIAgentClient(async_credential=credential) as chat_client,
):
# enable azure-ai observability
await chat_client.setup_observability()
await chat_client.setup_azure_ai_observability()
agent = chat_client.create_agent(
name="DocsAgent",
instructions="You are a helpful assistant that can help with microsoft documentation questions.",
@@ -50,7 +50,7 @@ async def main() -> None:
AzureAIAgentClient(async_credential=credential) as chat_client,
):
# enable azure-ai observability
await chat_client.setup_observability()
await chat_client.setup_azure_ai_observability()
agent = chat_client.create_agent(
name="DocsAgent",
instructions="You are a helpful assistant that can help with microsoft documentation questions.",
@@ -47,7 +47,7 @@ async def main():
# This will enable tracing and configure the application to send telemetry data to the
# Application Insights instance attached to the Azure AI project.
# This will override any existing configuration.
await client.setup_observability()
await client.setup_azure_ai_observability()
questions = ["What's the weather in Amsterdam?", "and in Paris, and which is better?", "Why is the sky blue?"]
@@ -68,7 +68,7 @@ async def main() -> None:
# This will enable tracing and configure the application to send telemetry data to the
# Application Insights instance attached to the Azure AI project.
# This will override any existing configuration.
await client.setup_observability()
await client.setup_azure_ai_observability()
with get_tracer().start_as_current_span(
name="Foundry Telemetry from Agent Framework", kind=SpanKind.CLIENT