dm-aioaiagent 0.4.6__tar.gz → 0.4.8__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.2
2
2
  Name: dm-aioaiagent
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Summary: This is my custom aioaiagent client
5
5
  Home-page: https://pypi.org/project/dm-aioaiagent
6
6
  Author: dimka4621
@@ -25,8 +25,8 @@ class DMAIAgent:
25
25
  tools: list[BaseTool] = None,
26
26
  *,
27
27
  model: str = "gpt-4o-mini",
28
- temperature: int = 1,
29
- parallel_tool_calls: bool = True,
28
+ temperature: float = None,
29
+ parallel_tool_calls: bool = None,
30
30
  agent_name: str = "AIAgent",
31
31
  input_output_logging: bool = True,
32
32
  is_memory_enabled: bool = True,
@@ -44,8 +44,8 @@ class DMAIAgent:
44
44
  self._tools = tools or []
45
45
  self._is_tools_exists = bool(tools)
46
46
  self._model = str(model)
47
- self._temperature = int(temperature)
48
- self._parallel_tool_calls = bool(parallel_tool_calls)
47
+ self._temperature = temperature
48
+ self._parallel_tool_calls = parallel_tool_calls
49
49
  self._llm_provider_api_key = str(llm_provider_api_key)
50
50
  self._llm_provider_base_url = str(llm_provider_base_url)
51
51
 
@@ -193,27 +193,28 @@ class DMAIAgent:
193
193
  return route
194
194
 
195
195
  def _init_agent(self) -> None:
196
- base_kwargs = {
197
- "model": self._model,
198
- "temperature": self._temperature,
199
- "base_url": self._llm_provider_base_url if self._llm_provider_base_url else None
200
- }
196
+ base_kwargs = {"model": self._model}
197
+ if isinstance(self._temperature, float):
198
+ base_kwargs["temperature"] = self._temperature
201
199
  if self._llm_provider_api_key:
202
200
  base_kwargs["api_key"] = SecretStr(self._llm_provider_api_key)
201
+ if self._llm_provider_base_url:
202
+ base_kwargs["base_url"] = self._llm_provider_base_url
203
203
 
204
204
  if self._model.startswith("claude"):
205
205
  from langchain_anthropic import ChatAnthropic
206
206
 
207
207
  llm = ChatAnthropic(**base_kwargs)
208
- bind_tool_kwargs = {"tool_choice": {
209
- "type": "auto",
210
- "disable_parallel_tool_use": not self._parallel_tool_calls
211
- }}
208
+ bind_tool_kwargs = {"tool_choice": {"type": "auto"}}
209
+ if isinstance(self._parallel_tool_calls, bool):
210
+ bind_tool_kwargs["tool_choice"]["disable_parallel_tool_use"] = not self._parallel_tool_calls
212
211
  else:
213
212
  from langchain_openai import ChatOpenAI
214
213
 
215
214
  llm = ChatOpenAI(**base_kwargs)
216
- bind_tool_kwargs = {"parallel_tool_calls": self._parallel_tool_calls}
215
+ bind_tool_kwargs = {}
216
+ if isinstance(self._parallel_tool_calls, bool):
217
+ bind_tool_kwargs["parallel_tool_calls"] = self._parallel_tool_calls
217
218
 
218
219
  if self._is_tools_exists:
219
220
  self._tool_map = {t.name: t for t in self._tools}
@@ -1,4 +1,3 @@
1
- import sys
2
1
  import uuid
3
2
  import asyncio
4
3
  from typing import Any
@@ -7,9 +6,6 @@ from langchain_core.messages import AIMessage, ToolMessage
7
6
  from .ai_agent import DMAIAgent
8
7
  from .types import *
9
8
 
10
- if sys.platform == "win32":
11
- asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
12
-
13
9
  __all__ = ["DMAioAIAgent"]
14
10
 
15
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: dm-aioaiagent
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Summary: This is my custom aioaiagent client
5
5
  Home-page: https://pypi.org/project/dm-aioaiagent
6
6
  Author: dimka4621
@@ -8,7 +8,7 @@ def readme():
8
8
 
9
9
  setup(
10
10
  name='dm-aioaiagent',
11
- version='v0.4.6',
11
+ version='v0.4.8',
12
12
  author='dimka4621',
13
13
  author_email='mismartconfig@gmail.com',
14
14
  description='This is my custom aioaiagent client',
File without changes
File without changes