Skip to content

Commit b873d0e

Browse files
authored
Release/v0.2.11 (Pipelex#41)
### πŸ“ Description - HotFix for v0.2.10 πŸ‘‡ regarding the new pipelex/pipelex_init.toml` ### πŸ”„ Type of Change - [X] πŸ› Bug fix - [ ] ✨ New feature - [ ] πŸ’₯ Breaking change - [ ] πŸ“š Documentation update - [ ] 🧹 Code refactor - [ ] ⚑ Performance improvement - [X] βœ… Test update ### πŸ§ͺ Tests - test_load_pipelex_init_config
1 parent 8069e97 commit b873d0e

7 files changed

Lines changed: 117 additions & 82 deletions

File tree

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v0.2.11] - 2025-06-02
4+
5+
- HotFix for v0.2.10 πŸ‘‡ regarding the new pipelex/pipelex_init.toml`
6+
37
## [v0.2.10] - 2025-06-02
48

59
### Highlights

β€Žpipelex/hub.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ def set_instance(cls, pipelex_hub: "PipelexHub") -> None:
8282

8383
# tools
8484

85-
def setup_config(self, config_cls: Type[ConfigRoot]):
85+
def setup_config(self, config_cls: Type[ConfigRoot], specific_config_path: Optional[str] = None):
8686
"""
8787
Set the global configuration instance.
8888
8989
# Args:
9090
# config (Config): The configuration instance to set.
9191
"""
92-
config = config_manager.load_config()
92+
config = config_manager.load_config(specific_config_path)
9393
config["project_name"] = config_manager.get_project_name()
9494
self.set_config(config=config_cls.model_validate(config))
9595

β€Žpipelex/pipelex_init.tomlβ€Ž

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,39 @@ api_key_method = "env"
99
# This overrrides the defaults set for any llm handle
1010
"gpt-4o-mini" = "openai"
1111

12-
[cogt.llm_config.openai_openai_config]
12+
[plugins]
13+
14+
[plugins.openai_config]
15+
image_output_compression = 100
1316
api_key_method = "env"
1417

15-
[cogt.llm_config.azure_openai_config]
18+
[plugins.azure_openai_config]
1619
api_key_method = "env"
1720

18-
[cogt.llm_config.perplexity_config]
21+
# TODO: handle multiple azure openai accounts with different resource groups and account names for various llm model
22+
23+
[plugins.perplexity_config]
1924
api_key_method = "env"
2025

21-
[cogt.llm_config.vertexai_config]
26+
[plugins.xai_config]
2227
api_key_method = "env"
2328

24-
[cogt.llm_config.mistral_config]
29+
[plugins.vertexai_config]
2530
api_key_method = "env"
2631

27-
[cogt.llm_config.anthropic_config]
32+
[plugins.mistral_config]
2833
api_key_method = "env"
2934

30-
[cogt.llm_config.bedrock_config]
35+
[plugins.bedrock_config]
3136
client_method = "aioboto3"
3237

38+
[plugins.anthropic_config]
39+
claude_4_reduced_tokens_limit = 8192 # use "unlimited" to enable the full 32/64K tokens Opus/Sonet but it raises streaming/timeout issues
40+
api_key_method = "env"
41+
42+
[plugins.custom_endpoint_config]
43+
api_key_method = "env"
44+
3345
####################################################################################################
3446
# OCR config
3547
####################################################################################################

β€Žpipelex/tools/config/manager.pyβ€Ž

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
CONFIG_NAME = "pipelex.toml"
1616

1717

18+
class ConfigException(Exception):
19+
pass
20+
21+
1822
class ConfigManager:
1923
@property
2024
def is_in_pipelex_config(self) -> bool:
@@ -100,7 +104,7 @@ def load_inheritance_config(self, the_pipelex_config: Dict[str, Any]):
100104
if config:
101105
deep_update(the_pipelex_config, config)
102106

103-
def load_config(self) -> Dict[str, Any]:
107+
def load_config(self, specific_config_path: Optional[str] = None) -> Dict[str, Any]:
104108
"""Load and merge configurations from pipelex and local config files.
105109
106110
The configuration is loaded and merged in the following order:
@@ -115,6 +119,7 @@ def load_config(self) -> Dict[str, Any]:
115119
Returns:
116120
Dict[str, Any]: The merged configuration dictionary
117121
"""
122+
118123
#################### 1. Load pipelex config ####################
119124
pipelex_config = self.get_pipelex_config()
120125

@@ -141,6 +146,14 @@ def load_config(self) -> Dict[str, Any]:
141146
if override_dict := failable_load_toml_from_path(override_path):
142147
deep_update(pipelex_config, override_dict)
143148

149+
#################### 5. Load specific config ####################
150+
if specific_config_path:
151+
config = failable_load_toml_from_path(specific_config_path)
152+
if config:
153+
deep_update(pipelex_config, config)
154+
else:
155+
raise ConfigException(f"Failed to load specific config from {specific_config_path}")
156+
144157
return pipelex_config
145158

146159
def get_project_name(self) -> Optional[str]:

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pipelex"
3-
version = "0.2.10"
3+
version = "0.2.11"
44
description = "Pipelex is an open-source dev tool based on a simple declarative language that lets you define replicable, structured, composable LLM pipelines."
55
authors = [{ name = "Evotis S.A.S.", email = "evotis@pipelex.com" }]
66
maintainers = [{ name = "Pipelex staff", email = "oss@pipelex.com" }]

β€Žtests/tools/config/test_config_manager.pyβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from pipelex import pretty_print
2+
from pipelex.config import PipelexConfig
3+
from pipelex.hub import get_pipelex_hub
24
from pipelex.tools.config.manager import config_manager
35

46

@@ -7,3 +9,7 @@ def test_get_project_name(self):
79
project_name = config_manager.get_project_name()
810
pretty_print(project_name, title="project_name")
911
assert project_name == "pipelex"
12+
13+
def test_load_pipelex_init_config(self):
14+
hub = get_pipelex_hub()
15+
hub.setup_config(config_cls=PipelexConfig, specific_config_path="pipelex/pipelex_init.toml")

0 commit comments

Comments
Β (0)