Skip to content

Workaround OpenAI assistant's RunCreationOption's tools override - #6512

Merged
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:assistanttoolsmerge
Jun 12, 2025
Merged

Workaround OpenAI assistant's RunCreationOption's tools override#6512
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:assistanttoolsmerge

Conversation

@stephentoub

@stephentoubstephentoub commented Jun 11, 2025

Copy link
Copy Markdown
Member

In OpenAIAssistantChatClient, as part of providing ChatOptions.Tools to the service, the only API available to do so is ToolsOverride, which ends up replacing rather than augmenting any tools defined at the assistant level. To work around that, this changes the implementation to retrieve the assistant's tools and send them as part of the override, effectively implementing a merge rather than override.

Microsoft Reviewers: Open in CodeFlow

In OpenAIAssistantChatClient, as part of providing ChatOptions.Tools to the service, the only API available to do so is ToolsOverride, which ends up replacing rather than augmenting any tools defined at the assistant level. To work around that, this changes the implementation to retrieve the assistant's tools and send them as part of the override, effectively implementing a merge rather than override.
@stephentoub
stephentoub requested a review from a team as a code ownerJune 11, 2025 02:38
@github-actionsgithub-actionsBot added the area-ai Microsoft.Extensions.AI libraries label Jun 11, 2025
@stephentoub
stephentoub merged commit 4bea223 into dotnet:mainJun 12, 2025
@stephentoub
stephentoub deleted the assistanttoolsmerge branch June 12, 2025 15:27
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 13, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-aiMicrosoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@stephentoub@eiriktsarpalis