microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.76k stars 3.24k forks source link

.Net: [AgentBuilder] DeploymentNotFound - The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes #5394

Closed uday31in closed 7 months ago

uday31in commented 7 months ago

Describe the bug

var builder = new AgentBuilder()
        .WithAzureOpenAIChatCompletion(azureEndpoint, model, apiKey);

Screenshots

Headers:
apim-request-id: REDACTED
x-ms-client-request-id: 9019dfce-1b2f-4de3-bd19-0db0c3fa158f
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
x-ms-region: REDACTED
Date: Fri, 08 Mar 2024 23:43:08 GMT
Content-Length: 198
Content-Type: application/json

 ---> Azure.RequestFailedException: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
Status: 404 (Not Found)
ErrorCode: DeploymentNotFound

Platform

Additional context

    <PackageReference Include="Microsoft.SemanticKernel" Version="1.5.0-nightly-240307.1" />
    <PackageReference Include="Microsoft.SemanticKernel.Planners.Handlebars" Version="1.5.0-nightly-240307.1" />
    <PackageReference Include="Microsoft.SemanticKernel.Experimental.Agents" Version="1.5.0-alpha" />
uday31in commented 7 months ago

Deployment do exist and CURL request works:

curl https://up1-assistant.openai.azure.com/openai/assistants?api-version=2024-02-15-preview \
  -H "api-key: $AZURE_OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instructions": "You are an AI assistant that can write code to help answer math questions.",
    "name": "Math Assist",
    "tools": [{"type": "code_interpreter"}],
    "model": "gpt4-1106"
  }'

Response

{
  "id": "asst_0ujK2mtymmJJ8wkqmmAnSQf3",
  "object": "assistant",
  "created_at": 1709941856,
  "name": "Math Assist",
  "description": null,
  "model": "gpt4-1106",
  "instructions": "You are an AI assistant that can write code to help answer math questions.",
  "tools": [
    {
      "type": "code_interpreter"
    }
  ],
  "file_ids": [],
  "metadata": {}
}
uday31in commented 7 months ago

Took longer than 5 minutes but it is working now.