File tree 3 files changed +16
-5
lines changed
src/seer/automation/agent
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ chromadb==0.4.14
99
99
google-cloud-storage==2.*
100
100
google-cloud-aiplatform==1.*
101
101
google-cloud-secret-manager==2.*
102
- anthropic[vertex]==0.34.2
102
+ anthropic[vertex]==0.41.0
103
103
langfuse @ git+https://github.com/jennmueng/langfuse-python.git@9d9350de1e4e84fa548fe84f82c1b826be17956e
104
104
watchdog
105
105
stumpy==1.13.0
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ amqp==5.3.1
21
21
# via kombu
22
22
annotated-types == 0.7.0
23
23
# via pydantic
24
- anthropic == 0.34.2
24
+ anthropic == 0.41.0
25
25
# via -r requirements-constraints.txt
26
26
anyio == 4.7.0
27
27
# via
@@ -268,7 +268,7 @@ httpcore==1.0.7
268
268
# via httpx
269
269
httptools == 0.6.4
270
270
# via uvicorn
271
- httpx == 0.27.2
271
+ httpx == 0.28.1
272
272
# via
273
273
# -r requirements-constraints.txt
274
274
# anthropic
@@ -700,7 +700,6 @@ sniffio==1.3.1
700
700
# via
701
701
# anthropic
702
702
# anyio
703
- # httpx
704
703
# openai
705
704
sqlalchemy == 2.0.25
706
705
# via
@@ -730,7 +729,6 @@ threadpoolctl==3.2.0
730
729
# scikit-learn
731
730
tokenizers == 0.15.2
732
731
# via
733
- # anthropic
734
732
# chromadb
735
733
# transformers
736
734
torch == 2.2.0
Original file line number Diff line number Diff line change 7
7
import anthropic
8
8
from anthropic import NOT_GIVEN
9
9
from anthropic .types import (
10
+ CacheControlEphemeralParam ,
10
11
MessageParam ,
11
12
TextBlockParam ,
12
13
ToolParam ,
@@ -542,10 +543,22 @@ def _prep_message_and_tools(
542
543
message_dicts = [cls .to_message_param (message ) for message in messages ] if messages else []
543
544
if prompt :
544
545
message_dicts .append (cls .to_message_param (Message (role = "user" , content = prompt )))
546
+ # Set caching breakpoints for the last message and the 3rd last message
547
+ if len (message_dicts ) > 0 and message_dicts [- 1 ]["content" ]:
548
+ message_dicts [- 1 ]["content" ][0 ]["cache_control" ] = CacheControlEphemeralParam (
549
+ type = "ephemeral"
550
+ )
551
+ if len (message_dicts ) >= 4 and message_dicts [- 4 ]["content" ]:
552
+ message_dicts [- 4 ]["content" ][0 ]["cache_control" ] = CacheControlEphemeralParam (
553
+ type = "ephemeral"
554
+ )
545
555
546
556
tool_dicts = (
547
557
[cls .to_tool_dict (tool ) for tool in tools ] if tools and len (tools ) > 0 else None
548
558
)
559
+ # set caching breakpoint at end of tools
560
+ if tool_dicts :
561
+ tool_dicts [- 1 ]["cache_control" ] = CacheControlEphemeralParam (type = "ephemeral" )
549
562
550
563
return message_dicts , tool_dicts , system_prompt
551
564
You can’t perform that action at this time.
0 commit comments