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

Update anthropic type imports for v0.41.0 release #17299

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
TextBlock,
)

from anthropic.types import MessageParam, TextBlockParam, ImageBlockParam
from anthropic.types import (
MessageParam,
TextBlockParam,
ImageBlockParam,
CacheControlEphemeralParam,
)
from anthropic.types.tool_result_block_param import ToolResultBlockParam
from anthropic.types.tool_use_block_param import ToolUseBlockParam
from anthropic.types.beta.prompt_caching import (
PromptCachingBetaTextBlockParam,
PromptCachingBetaCacheControlEphemeralParam,
)

HUMAN_PREFIX = "\n\nHuman:"
ASSISTANT_PREFIX = "\n\nAssistant:"
Expand Down Expand Up @@ -156,12 +157,10 @@ def messages_to_anthropic_messages(
for block in message.blocks:
if isinstance(block, TextBlock):
content_ = (
PromptCachingBetaTextBlockParam(
TextBlockParam(
text=block.text,
type="text",
cache_control=PromptCachingBetaCacheControlEphemeralParam(
type="ephemeral"
),
cache_control=CacheControlEphemeralParam(type="ephemeral"),
)
if "cache_control" in message.additional_kwargs
else TextBlockParam(text=block.text, type="text")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-anthropic"
readme = "README.md"
version = "0.6.1"
version = "0.6.3"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
anthropic = {extras = ["bedrock", "vertex"], version = ">=0.39.0"}
anthropic = {extras = ["bedrock", "vertex"], version = ">=0.41.0"}
llama-index-core = "^0.12.5"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version = "0.3.1"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
llama-index-llms-anthropic = "^0.5.0"
llama-index-llms-anthropic = "^0.6.3"
boto3 = "^1.34.26"
llama-index-core = "^0.12.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version = "0.3.0"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
llama-index-llms-anthropic = "^0.5.0"
llama-index-llms-anthropic = "^0.6.3"
portkey-ai = "^1.1.4"
portkey = "^0.1.2"
llama-index-llms-openai = "^0.3.0"
Expand Down
Loading