mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 03:30:06 +00:00
chore: add prompt cache for anthropic model (#1552)
This commit is contained in:
parent
86ec0ba6a7
commit
53ef106b3e
1 changed files with 7 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ def agent_model(
|
|||
for attr in config_attrs:
|
||||
effective_config[attr] = getattr(options, attr)
|
||||
extra_params = options.extra_params or {}
|
||||
|
||||
init_param_keys = {
|
||||
"api_version",
|
||||
"azure_ad_token",
|
||||
|
|
@ -135,6 +136,12 @@ def agent_model(
|
|||
)
|
||||
model_platform_enum = None
|
||||
|
||||
if (
|
||||
effective_config["model_platform"].lower() == "anthropic"
|
||||
and model_config.get("cache_control") is None
|
||||
):
|
||||
model_config["cache_control"] = "5m"
|
||||
|
||||
model = ModelFactory.create(
|
||||
model_platform=effective_config["model_platform"],
|
||||
model_type=effective_config["model_type"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue