diff --git a/README.md b/README.md index 64b0dbd821..e86cf94e60 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ async def main(): # api_version=os.environ["AZURE_OPENAI_API_VERSION"], # api_key=os.environ["AZURE_OPENAI_API_KEY"], # Optional if using AzureCliCredential credential=AzureCliCredential(), # Optional, if using api_key - ).create_agent( + ).as_agent( name="HaikuBot", instructions="You are an upbeat assistant that writes beautifully.", ) @@ -131,7 +131,7 @@ using OpenAI; // Replace the with your OpenAI API key. var agent = new OpenAIClient("") .GetOpenAIResponseClient("gpt-4o-mini") - .CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully."); + .AsAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully."); Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework.")); ``` @@ -150,7 +150,7 @@ var agent = new OpenAIClient( new BearerTokenPolicy(new AzureCliCredential(), "https://ai.azure.com/.default"), new OpenAIClientOptions() { Endpoint = new Uri("https://.openai.azure.com/openai/v1") }) .GetOpenAIResponseClient("gpt-4o-mini") - .CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully."); + .AsAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully."); Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework.")); ```