Skip to content

fix(openai): support custom headers in chat model config#885

Open
redflyingfish wants to merge 1 commit into
cloudwego:mainfrom
redflyingfish:fix/openai-custom-headers
Open

fix(openai): support custom headers in chat model config#885
redflyingfish wants to merge 1 commit into
cloudwego:mainfrom
redflyingfish:fix/openai-custom-headers

Conversation

@redflyingfish

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: (optional scope):
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

fix(openai): 支持在 chat model config 中配置自定义请求头

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
This PR adds CustomHeaders support to components/model/openai.ChatModelConfig.

Previously, OpenAI chat model users could pass custom headers through request options, while agenticopenai.ChatConfig already supported config-level custom headers. This PR aligns the OpenAI chat model config with that behavior by forwarding CustomHeaders to the underlying ACL OpenAI client.

It also updates the OpenAI component README files and adds a regression test.

Test:

cd components/model/openai
go test ./...

#### (Optional) Which issue(s) this PR fixes:

Fixes https://github.com/cloudwego/eino/issues/1048

#### (optional) The PR that updates user documentation:

N/A. Component README files in this PR were updated.

@mrh997 mrh997 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants