versionhq 1.2.3.6__tar.gz → 1.2.3.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.
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/PKG-INFO +1 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/pyproject.toml +1 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/__init__.py +1 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/model.py +22 -11
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/model.py +5 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq.egg-info/PKG-INFO +1 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent/agent_test.py +10 -11
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent/doc_test.py +0 -3
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent_network/agent_network_test.py +0 -3
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent_network/doc_test.py +3 -2
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/formation_test.py +0 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/knowledge/knowledge_test.py +0 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/llm/llm_connection_test.py +2 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/task_test.py +2 -2
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/tool/tool_test.py +0 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/usecase_test.py +0 -1
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/uv.lock +7 -7
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.env.sample +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.gitignore +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/.python-version +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/LICENSE +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/README.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/SECURITY.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/db/preprocess.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/CNAME +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent/config.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent/task-handling.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent-network/config.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent-network/form.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent-network/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/agent-network/ref.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/knowledge.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/llm/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/memory.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/rag-tool.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/evaluation.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/reference.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/task-execution.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/task-output.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task/task-strc-response.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/task-graph/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/core/tool.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/index.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/quickstart.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/docs/tags.md +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/mkdocs.yml +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/requirements-dev.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/requirements.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/runtime.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/setup.cfg +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/llm_as_a_judge.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent_network/formation.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/agent_network/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/evaluation.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task_graph/colors.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task_graph/draft.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/rag_tool.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq.egg-info/SOURCES.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/_sample/sample.csv +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/_sample/sample.json +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/conftest.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/doc_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/doc_eval_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/doc_taskoutput_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task/eval_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.3.6 → versionhq-1.2.3.8}/tests/tool/rag_tool_test.py +0 -0
@@ -15,7 +15,7 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
|
|
15
15
|
|
16
16
|
[project]
|
17
17
|
name = "versionhq"
|
18
|
-
version = "1.2.3.
|
18
|
+
version = "1.2.3.8"
|
19
19
|
authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
|
20
20
|
description = "An agentic orchestration framework for building agent networks that handle task automation."
|
21
21
|
readme = "README.md"
|
@@ -7,13 +7,12 @@ from dotenv import load_dotenv
|
|
7
7
|
from pydantic import UUID4, BaseModel, Field, InstanceOf, PrivateAttr, model_validator, field_validator
|
8
8
|
from pydantic_core import PydanticCustomError
|
9
9
|
|
10
|
-
from versionhq.
|
10
|
+
from versionhq.agent.rpm_controller import RPMController
|
11
11
|
from versionhq.tool.model import Tool, ToolSet, BaseTool
|
12
12
|
from versionhq.knowledge.model import BaseKnowledgeSource, Knowledge
|
13
13
|
from versionhq.memory.contextual_memory import ContextualMemory
|
14
14
|
from versionhq.memory.model import ShortTermMemory, LongTermMemory, UserMemory
|
15
15
|
from versionhq._utils.logger import Logger
|
16
|
-
from versionhq.agent.rpm_controller import RPMController
|
17
16
|
from versionhq._utils.process_config import process_config
|
18
17
|
|
19
18
|
|
@@ -68,8 +67,8 @@ class Agent(BaseModel):
|
|
68
67
|
callbacks: Optional[List[Callable]] = Field(default_factory=list, description="callback functions to execute after any task execution")
|
69
68
|
|
70
69
|
# llm settings cascaded to the LLM model
|
71
|
-
llm:
|
72
|
-
func_calling_llm:
|
70
|
+
llm: Any = Field(default=None, description="store LLM object")
|
71
|
+
func_calling_llm: Any = Field(default=None, description="store LLM object")
|
73
72
|
respect_context_window: bool = Field(default=True, description="keep messages under the context window size")
|
74
73
|
max_execution_time: Optional[int] = Field(default=None, description="max. task execution time in seconds")
|
75
74
|
max_rpm: Optional[int] = Field(default=None, description="max. number of requests per minute")
|
@@ -78,7 +77,6 @@ class Agent(BaseModel):
|
|
78
77
|
# # cache, error, ops handling
|
79
78
|
# formatting_errors: int = Field(default=0, description="number of formatting errors.")
|
80
79
|
|
81
|
-
|
82
80
|
@field_validator("id", mode="before")
|
83
81
|
@classmethod
|
84
82
|
def _deny_user_set_id(cls, v: Optional[UUID4]) -> None:
|
@@ -106,6 +104,8 @@ class Agent(BaseModel):
|
|
106
104
|
"""
|
107
105
|
Set up `llm` and `func_calling_llm` as valid LLM objects using the given kwargs.
|
108
106
|
"""
|
107
|
+
from versionhq.llm.model import LLM, DEFAULT_MODEL_NAME
|
108
|
+
|
109
109
|
self.llm = self._convert_to_llm_object(llm=self.llm)
|
110
110
|
|
111
111
|
func_calling_llm = self.func_calling_llm if self.func_calling_llm else self.llm if self.llm else None
|
@@ -151,7 +151,7 @@ class Agent(BaseModel):
|
|
151
151
|
setattr(tool, k, v)
|
152
152
|
tool_list.append(tool)
|
153
153
|
|
154
|
-
case callable():
|
154
|
+
case func if callable(func):
|
155
155
|
tool = Tool(func=item)
|
156
156
|
tool_list.append(tool)
|
157
157
|
|
@@ -267,11 +267,13 @@ class Agent(BaseModel):
|
|
267
267
|
return self
|
268
268
|
|
269
269
|
|
270
|
-
def _convert_to_llm_object(self, llm: Any = None)
|
270
|
+
def _convert_to_llm_object(self, llm: Any = None): # returns LLM object
|
271
271
|
"""
|
272
272
|
Convert the given value to LLM object.
|
273
273
|
When `llm` is dict or self.llm_config is not None, add these values to the LLM object after validating them.
|
274
274
|
"""
|
275
|
+
from versionhq.llm.model import LLM, DEFAULT_MODEL_NAME
|
276
|
+
|
275
277
|
llm = llm if llm else self.llm if self.llm else DEFAULT_MODEL_NAME
|
276
278
|
|
277
279
|
if not llm:
|
@@ -279,11 +281,11 @@ class Agent(BaseModel):
|
|
279
281
|
|
280
282
|
match llm:
|
281
283
|
case LLM():
|
282
|
-
return self._set_llm_params(
|
284
|
+
return self._set_llm_params(llm_obj=llm, config=self.llm_config)
|
283
285
|
|
284
286
|
case str():
|
285
287
|
llm = LLM(model=llm)
|
286
|
-
return self._set_llm_params(
|
288
|
+
return self._set_llm_params(llm_obj=llm, config=self.llm_config)
|
287
289
|
|
288
290
|
case dict():
|
289
291
|
model_name = llm.pop("model_name", llm.pop("deployment_name", str(llm)))
|
@@ -301,13 +303,20 @@ class Agent(BaseModel):
|
|
301
303
|
"base_url": getattr(llm, "base_url", None),
|
302
304
|
}
|
303
305
|
config = llm_params.update(self.llm_config) if self.llm_config else llm_params
|
304
|
-
return self._set_llm_params(
|
306
|
+
return self._set_llm_params(llm_obj=llm, config=config)
|
305
307
|
|
306
308
|
|
307
|
-
def _set_llm_params(self,
|
309
|
+
def _set_llm_params(self, llm_obj, config: Dict[str, Any] = None): # returns LLM object
|
308
310
|
"""
|
309
311
|
Add valid params to the LLM object.
|
310
312
|
"""
|
313
|
+
from versionhq.llm.model import LLM, DEFAULT_CONTEXT_WINDOW_SIZE
|
314
|
+
from versionhq.llm.llm_vars import PROVIDERS
|
315
|
+
|
316
|
+
llm = llm_obj if isinstance(llm_obj, LLM) else None
|
317
|
+
|
318
|
+
if not llm: return
|
319
|
+
|
311
320
|
if llm.provider is None:
|
312
321
|
provider_name = llm.model.split("/")[0]
|
313
322
|
valid_provider = provider_name if provider_name in PROVIDERS else None
|
@@ -352,6 +361,8 @@ class Agent(BaseModel):
|
|
352
361
|
"""
|
353
362
|
Fine-tuned the base model using OpenAI train framework.
|
354
363
|
"""
|
364
|
+
from versionhq.llm.model import LLM
|
365
|
+
|
355
366
|
if not isinstance(self.llm, LLM):
|
356
367
|
pass
|
357
368
|
|
@@ -144,6 +144,11 @@ class BaseTool(ABC, BaseModel):
|
|
144
144
|
class Tool(BaseTool):
|
145
145
|
func: Callable = Field(default=None)
|
146
146
|
|
147
|
+
# def __init__(self, func: Callable = None, *args, **kwargs):
|
148
|
+
# self.func = func
|
149
|
+
# super().__init__(*args, **kwargs)
|
150
|
+
|
151
|
+
|
147
152
|
@model_validator(mode="after")
|
148
153
|
def validate_func(self) -> Self:
|
149
154
|
if not self.func and not self._run:
|
@@ -172,23 +172,22 @@ def test_build_agent_with_llm_and_func_llm_object():
|
|
172
172
|
assert isinstance(agent.func_calling_llm, LLM)
|
173
173
|
|
174
174
|
|
175
|
-
|
176
|
-
test_build_agent_with_llm_config()
|
177
|
-
test_build_agent_with_llm_object()
|
178
|
-
test_build_agent_with_llm_and_func_llm_config()
|
179
|
-
test_build_agent_with_llm_and_func_llm_object()
|
180
|
-
|
181
|
-
|
182
|
-
def test_agent_with_random_dict_tools():
|
175
|
+
def test_agent_with_tools():
|
183
176
|
def empty_func():
|
184
177
|
return "empty function"
|
185
178
|
|
186
|
-
|
179
|
+
def custom_tool(query: str) -> str:
|
180
|
+
return query
|
181
|
+
|
182
|
+
agent = Agent(role="demo", goal="test a tool", tools=[dict(name="tool 1", func=empty_func), lambda x: x, custom_tool,])
|
187
183
|
|
188
|
-
assert [
|
184
|
+
assert agent.tools[0]._run() == "empty function"
|
189
185
|
assert agent.tools[0].name == "tool 1"
|
186
|
+
assert agent.tools[1]._run(x="hey") == "hey"
|
187
|
+
assert agent.tools[1].name == "random_func"
|
188
|
+
assert agent.tools[2]._run(query="hey") == "hey"
|
189
|
+
assert agent.tools[2].name == "custom_tool"
|
190
190
|
|
191
|
-
test_agent_with_random_dict_tools()
|
192
191
|
|
193
192
|
def test_agent_with_custom_tools():
|
194
193
|
def send_message(message: str) -> str:
|
@@ -23,7 +23,6 @@ def test_docs_core_agent_b1():
|
|
23
23
|
assert "gemini-2.0" in agent.llm.model and isinstance(agent.llm, LLM)
|
24
24
|
|
25
25
|
|
26
|
-
|
27
26
|
def test_docs_core_agent_b3():
|
28
27
|
import versionhq as vhq
|
29
28
|
|
@@ -135,7 +134,6 @@ def test_docs_core_agent_e2():
|
|
135
134
|
assert litellm.callbacks == agent.callbacks and len(agent.callbacks) == 2
|
136
135
|
|
137
136
|
|
138
|
-
|
139
137
|
def test_docs_core_agent_f():
|
140
138
|
import versionhq as vhq
|
141
139
|
|
@@ -159,7 +157,6 @@ def test_docs_core_agent_f():
|
|
159
157
|
assert agent.llm.llm_config["stop"] == "answer"
|
160
158
|
|
161
159
|
|
162
|
-
|
163
160
|
def test_docs_core_agent_g():
|
164
161
|
from versionhq import Agent
|
165
162
|
from versionhq.task.model import Task
|
@@ -12,7 +12,6 @@ def test_doc_an_formation_a():
|
|
12
12
|
assert network.tasks # auto-defined sub-tasks to achieve the main task goal
|
13
13
|
|
14
14
|
|
15
|
-
|
16
15
|
def test_doc_an_formation_b():
|
17
16
|
import versionhq as vhq
|
18
17
|
from pydantic import BaseModel
|
@@ -32,6 +31,7 @@ def test_doc_an_formation_b():
|
|
32
31
|
assert network.members
|
33
32
|
assert network.tasks
|
34
33
|
|
34
|
+
|
35
35
|
def test_doc_an_formation_c():
|
36
36
|
import versionhq as vhq
|
37
37
|
from pydantic import BaseModel
|
@@ -86,7 +86,6 @@ def test_doc_an_formation_d():
|
|
86
86
|
assert network.formation == vhq.Formation.SUPERVISING
|
87
87
|
|
88
88
|
|
89
|
-
|
90
89
|
def test_doc_an_config_a():
|
91
90
|
import versionhq as vhq
|
92
91
|
|
@@ -100,6 +99,7 @@ def test_doc_an_config_a():
|
|
100
99
|
)
|
101
100
|
assert isinstance(network.members[0].agent, vhq.Agent)
|
102
101
|
|
102
|
+
|
103
103
|
def test_doc_an_config_b():
|
104
104
|
import versionhq as vhq
|
105
105
|
|
@@ -114,6 +114,7 @@ def test_doc_an_config_b():
|
|
114
114
|
|
115
115
|
assert network.formation == vhq.Formation.SQUAD
|
116
116
|
|
117
|
+
|
117
118
|
def test_doc_an_config_c():
|
118
119
|
import versionhq as vhq
|
119
120
|
|
@@ -1,7 +1,8 @@
|
|
1
1
|
from unittest.mock import patch
|
2
2
|
from typing import Callable
|
3
3
|
|
4
|
-
from versionhq.agent.model import Agent
|
4
|
+
from versionhq.agent.model import Agent
|
5
|
+
from versionhq.llm.model import LLM
|
5
6
|
from versionhq.task.model import Task, ResponseField, TaskOutput
|
6
7
|
from versionhq.tool.model import Tool, ToolSet
|
7
8
|
from versionhq.tool.decorator import tool
|
@@ -176,7 +177,6 @@ def test_task_with_tools():
|
|
176
177
|
assert res.tool_output is not None
|
177
178
|
|
178
179
|
|
179
|
-
|
180
180
|
def test_task_without_response_format():
|
181
181
|
task = Task(description="return a simple output with any random values.")
|
182
182
|
res = task.execute()
|
@@ -2515,7 +2515,7 @@ name = "nvidia-cudnn-cu12"
|
|
2515
2515
|
version = "9.1.0.70"
|
2516
2516
|
source = { registry = "https://pypi.org/simple" }
|
2517
2517
|
dependencies = [
|
2518
|
-
{ name = "nvidia-cublas-cu12", marker = "
|
2518
|
+
{ name = "nvidia-cublas-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2519
2519
|
]
|
2520
2520
|
wheels = [
|
2521
2521
|
{ url = "https://files.pythonhosted.org/packages/9f/fd/713452cd72343f682b1c7b9321e23829f00b842ceaedcda96e742ea0b0b3/nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl", hash = "sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f", size = 664752741 },
|
@@ -2526,7 +2526,7 @@ name = "nvidia-cufft-cu12"
|
|
2526
2526
|
version = "11.2.1.3"
|
2527
2527
|
source = { registry = "https://pypi.org/simple" }
|
2528
2528
|
dependencies = [
|
2529
|
-
{ name = "nvidia-nvjitlink-cu12", marker = "
|
2529
|
+
{ name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2530
2530
|
]
|
2531
2531
|
wheels = [
|
2532
2532
|
{ url = "https://files.pythonhosted.org/packages/27/94/3266821f65b92b3138631e9c8e7fe1fb513804ac934485a8d05776e1dd43/nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f083fc24912aa410be21fa16d157fed2055dab1cc4b6934a0e03cba69eb242b9", size = 211459117 },
|
@@ -2545,9 +2545,9 @@ name = "nvidia-cusolver-cu12"
|
|
2545
2545
|
version = "11.6.1.9"
|
2546
2546
|
source = { registry = "https://pypi.org/simple" }
|
2547
2547
|
dependencies = [
|
2548
|
-
{ name = "nvidia-cublas-cu12", marker = "
|
2549
|
-
{ name = "nvidia-cusparse-cu12", marker = "
|
2550
|
-
{ name = "nvidia-nvjitlink-cu12", marker = "
|
2548
|
+
{ name = "nvidia-cublas-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2549
|
+
{ name = "nvidia-cusparse-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2550
|
+
{ name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2551
2551
|
]
|
2552
2552
|
wheels = [
|
2553
2553
|
{ url = "https://files.pythonhosted.org/packages/3a/e1/5b9089a4b2a4790dfdea8b3a006052cfecff58139d5a4e34cb1a51df8d6f/nvidia_cusolver_cu12-11.6.1.9-py3-none-manylinux2014_x86_64.whl", hash = "sha256:19e33fa442bcfd085b3086c4ebf7e8debc07cfe01e11513cc6d332fd918ac260", size = 127936057 },
|
@@ -2558,7 +2558,7 @@ name = "nvidia-cusparse-cu12"
|
|
2558
2558
|
version = "12.3.1.170"
|
2559
2559
|
source = { registry = "https://pypi.org/simple" }
|
2560
2560
|
dependencies = [
|
2561
|
-
{ name = "nvidia-nvjitlink-cu12", marker = "
|
2561
|
+
{ name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
2562
2562
|
]
|
2563
2563
|
wheels = [
|
2564
2564
|
{ url = "https://files.pythonhosted.org/packages/db/f7/97a9ea26ed4bbbfc2d470994b8b4f338ef663be97b8f677519ac195e113d/nvidia_cusparse_cu12-12.3.1.170-py3-none-manylinux2014_x86_64.whl", hash = "sha256:ea4f11a2904e2a8dc4b1833cc1b5181cde564edd0d5cd33e3c168eff2d1863f1", size = 207454763 },
|
@@ -4791,7 +4791,7 @@ wheels = [
|
|
4791
4791
|
|
4792
4792
|
[[package]]
|
4793
4793
|
name = "versionhq"
|
4794
|
-
version = "1.2.3.
|
4794
|
+
version = "1.2.3.8"
|
4795
4795
|
source = { editable = "." }
|
4796
4796
|
dependencies = [
|
4797
4797
|
{ name = "appdirs" },
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|