agentic-blocks 0.1.17__tar.gz → 0.1.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentic-blocks
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Simple building blocks for agentic AI systems with MCP client and conversation management
5
5
  Author-email: Magnus Bjelkenhed <bjelkenhed@gmail.com>
6
6
  License: MIT
@@ -14,7 +14,7 @@ agentic_blocks = []
14
14
 
15
15
  [project]
16
16
  name = "agentic-blocks"
17
- version = "0.1.17"
17
+ version = "0.1.18"
18
18
  description = "Simple building blocks for agentic AI systems with MCP client and conversation management"
19
19
  readme = "README.md"
20
20
  requires-python = ">=3.11"
@@ -35,8 +35,7 @@ class Agent:
35
35
  return shared["messages"]
36
36
 
37
37
  def exec(self, messages) -> Messages:
38
- model = "qwen/qwen3-235b-a22b-2507"
39
- response = call_llm(model=model, messages=messages, tools=self.tools)
38
+ response = call_llm(messages=messages, tools=self.tools)
40
39
  messages.add_response_message(response)
41
40
  return messages
42
41
 
@@ -22,7 +22,7 @@ def call_llm(
22
22
  messages: Union[Messages, List[Dict[str, Any]]],
23
23
  tools: Optional[Union[List[Dict[str, Any]], List]] = None,
24
24
  api_key: Optional[str] = None,
25
- model: str = "gpt-4o-mini",
25
+ model: Optional[str] = None,
26
26
  base_url: Optional[str] = None,
27
27
  **kwargs,
28
28
  ) -> Any:
@@ -52,6 +52,11 @@ def call_llm(
52
52
  if not api_key:
53
53
  api_key = os.getenv("OPENROUTER_API_KEY")
54
54
 
55
+ if not base_url:
56
+ base_url = os.getenv("BASE_URL")
57
+ if not model:
58
+ model = os.getenv("MODEL_ID")
59
+
55
60
  if not api_key and not base_url:
56
61
  raise LLMError(
57
62
  "API key not found. Set OPENROUTER_API_KEY or OPENAI_API_KEY environment variable or pass api_key parameter."
@@ -64,12 +69,7 @@ def call_llm(
64
69
  api_key = "EMPTY"
65
70
 
66
71
  # Initialize OpenAI client
67
- client_kwargs = {}
68
- if api_key:
69
- client_kwargs["api_key"] = api_key
70
- if base_url:
71
- client_kwargs["base_url"] = base_url
72
- client = OpenAI(**client_kwargs)
72
+ client = OpenAI(api_key=api_key, base_url=base_url)
73
73
 
74
74
  # Handle different message input types
75
75
  if isinstance(messages, Messages):
@@ -84,7 +84,7 @@ def call_llm(
84
84
  openai_tools = None
85
85
  if tools:
86
86
  # Check if it's a list of LangChain StructuredTools
87
- if tools and hasattr(tools[0], 'args_schema'):
87
+ if tools and hasattr(tools[0], "args_schema"):
88
88
  openai_tools = langchain_tools_to_openai_format(tools)
89
89
  else:
90
90
  openai_tools = tools
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentic-blocks
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Simple building blocks for agentic AI systems with MCP client and conversation management
5
5
  Author-email: Magnus Bjelkenhed <bjelkenhed@gmail.com>
6
6
  License: MIT
File without changes