mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix the environment variable name used for the model id (#622)
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
d992fb8311
commit
e1fda51d6a
@@ -8,7 +8,7 @@ using Azure.Identity;
|
||||
using Microsoft.Extensions.AI.Agents;
|
||||
|
||||
var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set.");
|
||||
var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
|
||||
var model = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_MODEL_ID") ?? "gpt-4o-mini";
|
||||
|
||||
const string JokerName = "Joker";
|
||||
const string JokerInstructions = "You are good at telling jokes.";
|
||||
@@ -18,7 +18,7 @@ var persistentAgentsClient = new PersistentAgentsClient(endpoint, new AzureCliCr
|
||||
|
||||
// You can create a server side persistent agent with the Azure.AI.Agents.Persistent SDK.
|
||||
var agentMetadata = await persistentAgentsClient.Administration.CreateAgentAsync(
|
||||
model: deploymentName,
|
||||
model: model,
|
||||
name: JokerName,
|
||||
instructions: JokerInstructions);
|
||||
|
||||
@@ -27,7 +27,7 @@ AIAgent agent1 = await persistentAgentsClient.GetAIAgentAsync(agentMetadata.Valu
|
||||
|
||||
// You can also create a server side persistent agent and return it as an AIAgent directly.
|
||||
AIAgent agent2 = await persistentAgentsClient.CreateAIAgentAsync(
|
||||
model: deploymentName,
|
||||
model: model,
|
||||
name: JokerName,
|
||||
instructions: JokerInstructions);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user