Skip to content

Commit

Permalink
add required header anthropic-version for AnthropicProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaohan Wang <xhwa73@gmail.com>
  • Loading branch information
xhw1 committed Feb 4, 2024
1 parent a06e82c commit e7b2852
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mlflow/gateway/providers/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def __init__(self, config: RouteConfig) -> None:
if config.model.config is None or not isinstance(config.model.config, AnthropicConfig):
raise TypeError(f"Invalid config type {config.model.config}")
self.anthropic_config: AnthropicConfig = config.model.config
self.headers = {"x-api-key": self.anthropic_config.anthropic_api_key}
self.headers = {
"x-api-key": self.anthropic_config.anthropic_api_key,
"anthropic-version": "2023-06-01",
}
self.base_url = "https://api.anthropic.com/v1/"

async def completions(self, payload: completions.RequestPayload) -> completions.ResponsePayload:
Expand Down

0 comments on commit e7b2852

Please sign in to comment.