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

how could we adding extra header into LitellmChatModel #260

Open
ashinwz opened this issue Jul 10, 2024 · 1 comment
Open

how could we adding extra header into LitellmChatModel #260

ashinwz opened this issue Jul 10, 2024 · 1 comment

Comments

@ashinwz
Copy link

ashinwz commented Jul 10, 2024

@prompt( "Say hello", model=LitellmChatModel( model = "gpt-4o", api_base = "", custom_llm_provider="azureopen", extra_header= { "Api-Key": "xxxx", "Content-Type": "application/json" } ), ) def say_hello_litellm() -> str: ...

format seem as above. Currently, litellm can support me to add the extra_header

response = completion( model="gpt-4o", messages=[{ "content": "Hello, how are you? say something","role": "user"}], api_base="", custom_llm_provider="azure", # litellm will use the openai.ChatCompletion to make the request, extra_headers = { "Api-Key": "xxx", "Content-Type": "application/json" } )

@jackmpcollins
Copy link
Owner

Hi @ashinwz Currently there isn't a way to do this in magentic. What do you put in the extra headers?

I would accept a PR to add this as an init parameter for the LitellmChatModel. For an example of that see PR #185 or PR #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants