Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Bug: Can't create OpenAIAssistantAgent with CreateAsync() #8344

Closed
MikeYeager opened this issue Aug 23, 2024 · 3 comments
Closed

.Net: Bug: Can't create OpenAIAssistantAgent with CreateAsync() #8344

MikeYeager opened this issue Aug 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@MikeYeager
Copy link

Describe the bug
According to the source code and all of the examples and documentation, this method takes an OpenAIAssistantConfiguration object as the second parameter, but when I use it, IntelliSense tells me I must use an OpenAIClientProvider object. In fact, OpenAIAssistantConfiguration is not defined. Am I missing a NuGet package or did the implementation change?

image

    <PackageReference Include="Microsoft.SemanticKernel" Version="1.18.0-rc" />
    <PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.18.0-rc" />
    <PackageReference Include="Microsoft.SemanticKernel.Agents.OpenAI" Version="1.18.0-alpha" />

I am using OpenAIClientProvider.ForAzureOpenAI(_apiKey, new Uri(_endpoint)) for the parameter, but when it's executed, I get an exception: "HTTP 404 (invalid_request_error: ) Invalid URL (POST /v1/assistants)" with this stack trace:

   at Azure.AI.OpenAI.ClientPipelineExtensions.<ProcessMessageAsync>d__0.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Azure.AI.OpenAI.Assistants.AzureAssistantClient.<CreateAssistantAsync>d__4.MoveNext()
   at OpenAI.Assistants.AssistantClient.<CreateAssistantAsync>d__46.MoveNext()
   at Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent.<CreateAsync>d__23.MoveNext()
   at SKLasVegas.Program.<Agents>d__9.MoveNext() in C:\Users\MYeager\Dropbox\AI\SK DevIntersections Las Vegas 2024\SampleCode\SKVegas\Program.cs:line 208
   at SKLasVegas.Program.<Main>d__3.MoveNext() in C:\Users\MYeager\Dropbox\AI\SK DevIntersections Las Vegas 2024\SampleCode\SKVegas\Program.cs:line 34

Here is my code...

            OpenAIAssistantAgent agent =
                await OpenAIAssistantAgent.CreateAsync(
                    kernel: kernel,
                    clientProvider: OpenAIClientProvider.ForAzureOpenAI(_apiKey, new Uri(_endpoint)),
                    definition: new OpenAIAssistantDefinition(_defaultDeployment)
                    {
                        Description = "This is a test agent",
                        EnableCodeInterpreter = true,
                        EnableFileSearch = true,
                        EnableJsonResponse = true,
                        //ExecutionOptions = new OpenAIAssistantExecutionOptions {  }
                        Instructions = "This is a test agent", //system instructions
                        Name = "MyAgent",
                        Temperature = (float?)0.9,
                        //VectorStoreId = "??",
                    });

Platform

  • OS: windows 11 x64
  • IDE: Visual Studio 2022
  • Language: C#

Thanks in advance.

@MikeYeager MikeYeager added the bug Something isn't working label Aug 23, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Aug 23, 2024
@github-actions github-actions bot changed the title Bug: Can't create OpenAIAssistantAgent with CreateAsync() .Net: Bug: Can't create OpenAIAssistantAgent with CreateAsync() Aug 23, 2024
@evchaki evchaki removed the triage label Aug 26, 2024
@markwallace-microsoft
Copy link
Member

@MikeYeager The 1.18.0-rc code is not merged to main yet, the code is still in the feature-connectors-openai feature branch so please go here to see the samples https://github.com/microsoft/semantic-kernel/tree/feature-connectors-openai/dotnet/samples

@MikeYeager
Copy link
Author

Thank you for that. FYI, the samples appear to be broken at the moment.
image

@MikeYeager
Copy link
Author

Any news on this? 1.21.1 is out now and this branch no longer exists, but I'm still getting the same error. Should I open a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

No branches or pull requests

3 participants