mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
anthropic types fix
This commit is contained in:
@@ -5,12 +5,12 @@ from typing import Any, TypeVar, overload
|
||||
|
||||
import httpx
|
||||
from anthropic import (
|
||||
NOT_GIVEN,
|
||||
APIConnectionError,
|
||||
APIStatusError,
|
||||
AsyncAnthropic,
|
||||
NotGiven,
|
||||
RateLimitError,
|
||||
omit,
|
||||
)
|
||||
from anthropic.types import CacheControlEphemeralParam, Message, ToolParam
|
||||
from anthropic.types.model_param import ModelParam
|
||||
@@ -141,7 +141,7 @@ class ChatAnthropic(BaseChatModel):
|
||||
response = await self.get_client().messages.create(
|
||||
model=self.model,
|
||||
messages=anthropic_messages,
|
||||
system=system_prompt or NOT_GIVEN,
|
||||
system=system_prompt or omit,
|
||||
**self._get_client_params_for_invoke(),
|
||||
)
|
||||
|
||||
@@ -192,7 +192,7 @@ class ChatAnthropic(BaseChatModel):
|
||||
model=self.model,
|
||||
messages=anthropic_messages,
|
||||
tools=[tool],
|
||||
system=system_prompt or NOT_GIVEN,
|
||||
system=system_prompt or omit,
|
||||
tool_choice=tool_choice,
|
||||
**self._get_client_params_for_invoke(),
|
||||
)
|
||||
|
||||
@@ -4,11 +4,11 @@ from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING, Any, TypeVar, overload
|
||||
|
||||
from anthropic import (
|
||||
NOT_GIVEN,
|
||||
APIConnectionError,
|
||||
APIStatusError,
|
||||
AsyncAnthropicBedrock,
|
||||
RateLimitError,
|
||||
omit,
|
||||
)
|
||||
from anthropic.types import CacheControlEphemeralParam, Message, ToolParam
|
||||
from anthropic.types.text_block import TextBlock
|
||||
@@ -163,7 +163,7 @@ class ChatAnthropicBedrock(ChatAWSBedrock):
|
||||
response = await self.get_client().messages.create(
|
||||
model=self.model,
|
||||
messages=anthropic_messages,
|
||||
system=system_prompt or NOT_GIVEN,
|
||||
system=system_prompt or omit,
|
||||
**self._get_client_params_for_invoke(),
|
||||
)
|
||||
|
||||
@@ -206,7 +206,7 @@ class ChatAnthropicBedrock(ChatAWSBedrock):
|
||||
model=self.model,
|
||||
messages=anthropic_messages,
|
||||
tools=[tool],
|
||||
system=system_prompt or NOT_GIVEN,
|
||||
system=system_prompt or omit,
|
||||
tool_choice=tool_choice,
|
||||
**self._get_client_params_for_invoke(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user