Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.
Add claude-4.6-sonnet model, bedrock token auth, and empty list display fix
Louis Choquele5f67bea1ad4
diff --git a/.pipelex-dev/test_profiles.toml b/.pipelex-dev/test_profiles.tomlindex 18f588987..c300b0980 100644--- a/.pipelex-dev/test_profiles.toml+++ b/.pipelex-dev/test_profiles.toml@@ -66,6 +66,7 @@ anthropic = ["claude-4.5-haiku","claude-4.5-sonnet","claude-4.5-opus",+ "claude-4.6-sonnet","claude-4.6-opus","claude-4.7-opus",]diff --git a/.pipelex/inference/backends/anthropic.toml b/.pipelex/inference/backends/anthropic.tomlindex 88b6d412d..8709b5347 100644--- a/.pipelex/inference/backends/anthropic.toml+++ b/.pipelex/inference/backends/anthropic.toml@@ -101,6 +101,15 @@ outputs = ["text", "structured"]max_prompt_images = 100costs = { input = 5.0, output = 25.0 }+["claude-4.6-sonnet"]+model_id = "claude-sonnet-4-6"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "adaptive"+["claude-4.6-opus"]model_id = "claude-opus-4-6"max_tokens = 64000diff --git a/.pipelex/inference/backends/bedrock.toml b/.pipelex/inference/backends/bedrock.tomlindex 6b263ea5c..4a8e98df4 100644--- a/.pipelex/inference/backends/bedrock.toml+++ b/.pipelex/inference/backends/bedrock.toml@@ -125,6 +125,16 @@ max_prompt_images = 100costs = { input = 5.0, output = 25.0 }thinking_mode = "manual"+["claude-4.6-sonnet"]+sdk = "bedrock_anthropic"+model_id = "global.anthropic.claude-sonnet-4-6"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "adaptive"+["claude-4.6-opus"]sdk = "bedrock_anthropic"model_id = "global.anthropic.claude-opus-4-6-v1"diff --git a/.pipelex/inference/deck/1_llm_deck.toml b/.pipelex/inference/deck/1_llm_deck.tomlindex 649576bd5..e83bf0825 100644--- a/.pipelex/inference/deck/1_llm_deck.toml+++ b/.pipelex/inference/deck/1_llm_deck.toml@@ -28,12 +28,12 @@ for_object = "@default-general"[llm.aliases]best-gpt = "gpt-5.2"-best-claude = "claude-4.5-opus"+best-claude = "claude-4.6-opus"best-gemini = "gemini-3.0-pro"best-mistral = "mistral-large"# Default aliases (first choice from waterfalls)-default-general = "claude-4.5-sonnet"+default-general = "claude-4.6-sonnet"default-premium = "claude-4.6-opus"default-premium-vision = "claude-4.6-opus"default-premium-structured = "claude-4.6-opus"diff --git a/.vscode/launch.json b/.vscode/launch.jsonindex 615724208..a5d7ec69f 100644--- a/.vscode/launch.json+++ b/.vscode/launch.json@@ -100,7 +100,7 @@"args": ["run","bundle",- "tests/integration/pipelex/pipes/pipelines/test_image_out_in.mthds",+ "/Users/lchoquel/repos/Pipelex/pipelex-demos/mthds-wip/fashion_moodboard",],"console": "integratedTerminal","justMyCode": falsediff --git a/docs/configuration/config-technical/aws-config.md b/docs/configuration/config-technical/aws-config.mdindex 294549380..cc67d631c 100644--- a/docs/configuration/config-technical/aws-config.md+++ b/docs/configuration/config-technical/aws-config.md@@ -15,6 +15,7 @@ The AWS configuration controls how Pipelex authenticates with AWS services. It s```toml[pipelex.aws_config]api_key_method = "env" # or "secret_provider"+bedrock_access_variant = "bedrock_token" # or "aws_access"```### Environment Variables Method (`"env"`)diff --git a/pipelex/kit/configs/inference/backends/anthropic.toml b/pipelex/kit/configs/inference/backends/anthropic.tomlindex 88b6d412d..8709b5347 100644--- a/pipelex/kit/configs/inference/backends/anthropic.toml+++ b/pipelex/kit/configs/inference/backends/anthropic.toml@@ -101,6 +101,15 @@ outputs = ["text", "structured"]max_prompt_images = 100costs = { input = 5.0, output = 25.0 }+["claude-4.6-sonnet"]+model_id = "claude-sonnet-4-6"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "adaptive"+["claude-4.6-opus"]model_id = "claude-opus-4-6"max_tokens = 64000diff --git a/pipelex/kit/configs/inference/backends/bedrock.toml b/pipelex/kit/configs/inference/backends/bedrock.tomlindex 6b263ea5c..4a8e98df4 100644--- a/pipelex/kit/configs/inference/backends/bedrock.toml+++ b/pipelex/kit/configs/inference/backends/bedrock.toml@@ -125,6 +125,16 @@ max_prompt_images = 100costs = { input = 5.0, output = 25.0 }thinking_mode = "manual"+["claude-4.6-sonnet"]+sdk = "bedrock_anthropic"+model_id = "global.anthropic.claude-sonnet-4-6"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "adaptive"+["claude-4.6-opus"]sdk = "bedrock_anthropic"model_id = "global.anthropic.claude-opus-4-6-v1"diff --git a/pipelex/kit/configs/inference/deck/1_llm_deck.toml b/pipelex/kit/configs/inference/deck/1_llm_deck.tomlindex 649576bd5..e83bf0825 100644--- a/pipelex/kit/configs/inference/deck/1_llm_deck.toml+++ b/pipelex/kit/configs/inference/deck/1_llm_deck.toml@@ -28,12 +28,12 @@ for_object = "@default-general"[llm.aliases]best-gpt = "gpt-5.2"-best-claude = "claude-4.5-opus"+best-claude = "claude-4.6-opus"best-gemini = "gemini-3.0-pro"best-mistral = "mistral-large"# Default aliases (first choice from waterfalls)-default-general = "claude-4.5-sonnet"+default-general = "claude-4.6-sonnet"default-premium = "claude-4.6-opus"default-premium-vision = "claude-4.6-opus"default-premium-structured = "claude-4.6-opus"diff --git a/pipelex/pipe_operators/pipe_operator.py b/pipelex/pipe_operators/pipe_operator.pyindex c8b2a94f0..8e7f24cc2 100644--- a/pipelex/pipe_operators/pipe_operator.py+++ b/pipelex/pipe_operators/pipe_operator.py@@ -45,7 +45,9 @@ class PipeOperator(PipeAbstract, Generic[PipeOperatorOutputType]):if main_stuff.is_list:list_content: ListContent[StuffContent] = main_stuff.as_list_content() # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType]nb_items = len(list_content.items)- if nb_items == 1:+ if nb_items == 0:+ output_concept_with_multiplicity = "empty list"+ elif nb_items == 1:output_concept_with_multiplicity += " [1 item]"else:output_concept_with_multiplicity += f" [{nb_items} items]"diff --git a/pipelex/pipelex.toml b/pipelex/pipelex.tomlindex f9f74d391..4150be5df 100644--- a/pipelex/pipelex.toml+++ b/pipelex/pipelex.toml@@ -117,6 +117,7 @@ keywords_to_hilight = [][pipelex.aws_config]api_key_method = "env"+bedrock_access_variant = "bedrock_token"##################################################################################################### Cogt inference configdiff --git a/pipelex/plugins/anthropic/anthropic_factory.py b/pipelex/plugins/anthropic/anthropic_factory.pyindex 1879bf041..1ecd845da 100644--- a/pipelex/plugins/anthropic/anthropic_factory.py+++ b/pipelex/plugins/anthropic/anthropic_factory.py@@ -19,6 +19,7 @@ from pipelex.cogt.model_backends.backend import InferenceBackendfrom pipelex.cogt.usage.token_category import NbTokensByCategoryDict, TokenCategoryfrom pipelex.config import get_configfrom pipelex.plugins.plugin_sdk_registry import Plugin+from pipelex.tools.aws.aws_config import BedrockAccessVariantfrom pipelex.tools.uri.prepared_file import PreparedFile, PreparedFileBase64, PreparedFileHttpUrl, PreparedFileLocalPathfrom pipelex.types import StrEnum@@ -55,12 +56,18 @@ class AnthropicFactory:)case AnthropicSdkVariant.BEDROCK_ANTHROPIC:aws_config = get_config().pipelex.aws_config- aws_access_key_id, aws_secret_access_key, aws_region = aws_config.get_aws_access_keys()- return AsyncAnthropicBedrock(- aws_secret_key=aws_secret_access_key,- aws_access_key=aws_access_key_id,- aws_region=aws_region,- )+ match aws_config.bedrock_access_variant:+ case BedrockAccessVariant.AWS_ACCESS:+ aws_access_key_id, aws_secret_access_key, aws_region = aws_config.get_aws_access_keys()+ return AsyncAnthropicBedrock(+ aws_secret_key=aws_secret_access_key,+ aws_access_key=aws_access_key_id,+ aws_region=aws_region,+ )+ case BedrockAccessVariant.BEDROCK_TOKEN:+ return AsyncAnthropicBedrock(+ api_key=aws_config.get_bedrock_token(),+ )@staticmethoddef _make_image_block_param(prepped_image: PreparedFile) -> ImageBlockParam:diff --git a/pipelex/tools/aws/aws_config.py b/pipelex/tools/aws/aws_config.pyindex 9b61e0017..842df00f6 100644--- a/pipelex/tools/aws/aws_config.py+++ b/pipelex/tools/aws/aws_config.py@@ -18,13 +18,21 @@ class AwsKeyMethod(StrEnum):ENV = "env"+class BedrockAccessVariant(StrEnum):+ AWS_ACCESS = "aws_access"+ BEDROCK_TOKEN = "bedrock_token"++AWS_ACCESS_KEY_ID_VAR_NAME = "AWS_ACCESS_KEY_ID"AWS_SECRET_ACCESS_KEY_VAR_NAME = "AWS_SECRET_ACCESS_KEY"AWS_REGION_VAR_NAME = "AWS_REGION"+BEDROCK_TOKEN_VAR_NAME = "AWS_BEARER_TOKEN_BEDROCK"+class AwsConfig(ConfigModel):api_key_method: AwsKeyMethod = Field(strict=False)+ bedrock_access_variant: BedrockAccessVariant = Field(strict=False)def get_aws_access_keys(self) -> tuple[str, str, str]:return self.get_aws_access_keys_with_method(api_key_method=self.api_key_method)@@ -54,3 +62,10 @@ class AwsConfig(ConfigModel):log.verbose("Getting AWS region from environment (priority override) or from aws_config.")return aws_access_key_id, aws_secret_access_key, aws_region++ def get_bedrock_token(self) -> str:+ match self.api_key_method:+ case AwsKeyMethod.ENV:+ return get_required_env(BEDROCK_TOKEN_VAR_NAME)+ case AwsKeyMethod.SECRET_PROVIDER:+ return get_secret(BEDROCK_TOKEN_VAR_NAME)