lionagi 0.17.10__py3-none-any.whl → 0.17.11__py3-none-any.whl
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.
- lionagi/__init__.py +1 -2
- lionagi/_class_registry.py +1 -2
- lionagi/_errors.py +1 -2
- lionagi/adapters/async_postgres_adapter.py +2 -10
- lionagi/config.py +1 -2
- lionagi/fields/action.py +1 -2
- lionagi/fields/base.py +3 -0
- lionagi/fields/code.py +3 -0
- lionagi/fields/file.py +3 -0
- lionagi/fields/instruct.py +1 -2
- lionagi/fields/reason.py +1 -2
- lionagi/fields/research.py +3 -0
- lionagi/libs/__init__.py +1 -2
- lionagi/libs/file/__init__.py +1 -2
- lionagi/libs/file/chunk.py +1 -2
- lionagi/libs/file/process.py +1 -2
- lionagi/libs/schema/__init__.py +1 -2
- lionagi/libs/schema/as_readable.py +1 -2
- lionagi/libs/schema/extract_code_block.py +1 -2
- lionagi/libs/schema/extract_docstring.py +1 -2
- lionagi/libs/schema/function_to_schema.py +1 -2
- lionagi/libs/schema/load_pydantic_model_from_schema.py +1 -2
- lionagi/libs/validate/__init__.py +1 -2
- lionagi/libs/validate/common_field_validators.py +1 -2
- lionagi/libs/validate/validate_boolean.py +1 -2
- lionagi/ln/fuzzy/_string_similarity.py +1 -2
- lionagi/models/__init__.py +1 -2
- lionagi/models/field_model.py +0 -1
- lionagi/models/hashable_model.py +4 -2
- lionagi/models/model_params.py +1 -2
- lionagi/models/operable_model.py +1 -2
- lionagi/models/schema_model.py +1 -2
- lionagi/operations/ReAct/ReAct.py +1 -2
- lionagi/operations/ReAct/__init__.py +1 -2
- lionagi/operations/ReAct/utils.py +1 -2
- lionagi/operations/__init__.py +1 -2
- lionagi/operations/_act/__init__.py +1 -2
- lionagi/operations/_act/act.py +1 -2
- lionagi/operations/brainstorm/__init__.py +1 -2
- lionagi/operations/brainstorm/brainstorm.py +1 -2
- lionagi/operations/brainstorm/prompt.py +1 -2
- lionagi/operations/builder.py +1 -2
- lionagi/operations/chat/__init__.py +1 -2
- lionagi/operations/chat/chat.py +1 -2
- lionagi/operations/communicate/communicate.py +1 -2
- lionagi/operations/flow.py +1 -2
- lionagi/operations/instruct/__init__.py +1 -2
- lionagi/operations/instruct/instruct.py +1 -2
- lionagi/operations/interpret/__init__.py +1 -2
- lionagi/operations/interpret/interpret.py +1 -2
- lionagi/operations/operate/__init__.py +1 -2
- lionagi/operations/operate/operate.py +1 -2
- lionagi/operations/parse/__init__.py +1 -2
- lionagi/operations/parse/parse.py +1 -2
- lionagi/operations/plan/__init__.py +1 -2
- lionagi/operations/plan/plan.py +1 -2
- lionagi/operations/plan/prompt.py +1 -2
- lionagi/operations/select/__init__.py +1 -2
- lionagi/operations/select/select.py +1 -2
- lionagi/operations/select/utils.py +1 -2
- lionagi/operations/types.py +1 -2
- lionagi/operations/utils.py +1 -2
- lionagi/protocols/__init__.py +1 -2
- lionagi/protocols/_concepts.py +1 -2
- lionagi/protocols/action/__init__.py +1 -2
- lionagi/protocols/action/function_calling.py +3 -20
- lionagi/protocols/action/manager.py +34 -4
- lionagi/protocols/action/tool.py +1 -2
- lionagi/protocols/contracts.py +1 -2
- lionagi/protocols/forms/__init__.py +1 -2
- lionagi/protocols/forms/base.py +1 -2
- lionagi/protocols/forms/flow.py +1 -2
- lionagi/protocols/forms/form.py +1 -2
- lionagi/protocols/forms/report.py +1 -2
- lionagi/protocols/generic/__init__.py +1 -2
- lionagi/protocols/generic/element.py +17 -65
- lionagi/protocols/generic/event.py +1 -2
- lionagi/protocols/generic/log.py +14 -12
- lionagi/protocols/generic/pile.py +3 -4
- lionagi/protocols/generic/processor.py +1 -2
- lionagi/protocols/generic/progression.py +1 -2
- lionagi/protocols/graph/__init__.py +1 -2
- lionagi/protocols/graph/edge.py +1 -2
- lionagi/protocols/graph/graph.py +1 -2
- lionagi/protocols/graph/node.py +1 -2
- lionagi/protocols/ids.py +1 -2
- lionagi/protocols/mail/__init__.py +1 -2
- lionagi/protocols/mail/exchange.py +1 -2
- lionagi/protocols/mail/mail.py +1 -2
- lionagi/protocols/mail/mailbox.py +1 -2
- lionagi/protocols/mail/manager.py +1 -2
- lionagi/protocols/mail/package.py +1 -2
- lionagi/protocols/messages/__init__.py +1 -2
- lionagi/protocols/messages/action_request.py +1 -2
- lionagi/protocols/messages/action_response.py +1 -2
- lionagi/protocols/messages/assistant_response.py +1 -2
- lionagi/protocols/messages/base.py +1 -2
- lionagi/protocols/messages/instruction.py +1 -2
- lionagi/protocols/messages/manager.py +1 -2
- lionagi/protocols/messages/message.py +1 -2
- lionagi/protocols/messages/system.py +1 -2
- lionagi/protocols/operatives/__init__.py +1 -2
- lionagi/protocols/operatives/operative.py +1 -2
- lionagi/protocols/operatives/step.py +1 -2
- lionagi/protocols/types.py +1 -2
- lionagi/service/connections/__init__.py +1 -2
- lionagi/service/connections/api_calling.py +1 -2
- lionagi/service/connections/endpoint.py +1 -2
- lionagi/service/connections/endpoint_config.py +1 -2
- lionagi/service/connections/header_factory.py +1 -2
- lionagi/service/connections/match_endpoint.py +1 -2
- lionagi/service/connections/mcp/__init__.py +1 -2
- lionagi/service/connections/mcp/wrapper.py +1 -2
- lionagi/service/connections/providers/__init__.py +1 -2
- lionagi/service/connections/providers/anthropic_.py +1 -2
- lionagi/service/connections/providers/claude_code_cli.py +1 -2
- lionagi/service/connections/providers/exa_.py +1 -2
- lionagi/service/connections/providers/nvidia_nim_.py +2 -27
- lionagi/service/connections/providers/oai_.py +1 -2
- lionagi/service/connections/providers/ollama_.py +1 -2
- lionagi/service/connections/providers/perplexity_.py +1 -2
- lionagi/service/hooks/__init__.py +1 -1
- lionagi/service/hooks/_types.py +1 -1
- lionagi/service/hooks/_utils.py +1 -1
- lionagi/service/hooks/hook_event.py +1 -1
- lionagi/service/hooks/hook_registry.py +1 -1
- lionagi/service/hooks/hooked_event.py +1 -2
- lionagi/service/imodel.py +1 -2
- lionagi/service/manager.py +1 -2
- lionagi/service/rate_limited_processor.py +1 -2
- lionagi/service/resilience.py +1 -2
- lionagi/service/third_party/anthropic_models.py +1 -2
- lionagi/service/third_party/claude_code.py +1 -2
- lionagi/service/token_calculator.py +1 -2
- lionagi/service/types.py +1 -2
- lionagi/session/__init__.py +1 -2
- lionagi/session/branch.py +1 -2
- lionagi/session/session.py +1 -2
- lionagi/tools/__init__.py +1 -2
- lionagi/tools/base.py +1 -2
- lionagi/tools/file/__init__.py +1 -2
- lionagi/tools/file/reader.py +1 -2
- lionagi/tools/types.py +1 -2
- lionagi/utils.py +1 -2
- lionagi/version.py +1 -1
- {lionagi-0.17.10.dist-info → lionagi-0.17.11.dist-info}/METADATA +1 -1
- lionagi-0.17.11.dist-info/RECORD +199 -0
- lionagi-0.17.10.dist-info/RECORD +0 -199
- {lionagi-0.17.10.dist-info → lionagi-0.17.11.dist-info}/WHEEL +0 -0
- {lionagi-0.17.10.dist-info → lionagi-0.17.11.dist-info}/licenses/LICENSE +0 -0
lionagi/__init__.py
CHANGED
lionagi/_class_registry.py
CHANGED
lionagi/_errors.py
CHANGED
@@ -1,13 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
This adapter leverages pydapter's improved raw SQL handling.
|
5
|
-
No workarounds needed - pydapter now properly handles:
|
6
|
-
- Raw SQL without table parameter
|
7
|
-
- No table inspection for raw SQL
|
8
|
-
- ORDER BY operations
|
9
|
-
- Both SQLite and PostgreSQL connections
|
10
|
-
"""
|
1
|
+
# Copyright (c) 2023-2025, HaiyangLi <quantocean.li at gmail dot com>
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
11
3
|
|
12
4
|
from __future__ import annotations
|
13
5
|
|
lionagi/config.py
CHANGED
lionagi/fields/action.py
CHANGED
lionagi/fields/base.py
CHANGED
lionagi/fields/code.py
CHANGED
lionagi/fields/file.py
CHANGED
lionagi/fields/instruct.py
CHANGED
lionagi/fields/reason.py
CHANGED
lionagi/fields/research.py
CHANGED
lionagi/libs/__init__.py
CHANGED
lionagi/libs/file/__init__.py
CHANGED
lionagi/libs/file/chunk.py
CHANGED
lionagi/libs/file/process.py
CHANGED
lionagi/libs/schema/__init__.py
CHANGED
lionagi/models/__init__.py
CHANGED
lionagi/models/field_model.py
CHANGED
@@ -11,7 +11,6 @@ import threading
|
|
11
11
|
from collections import OrderedDict
|
12
12
|
from collections.abc import Callable
|
13
13
|
from dataclasses import dataclass
|
14
|
-
from dataclasses import field as dc_field
|
15
14
|
from typing import Annotated, Any, ClassVar
|
16
15
|
|
17
16
|
from typing_extensions import Self, override
|
lionagi/models/hashable_model.py
CHANGED
@@ -56,7 +56,9 @@ class HashableModel(BaseModel):
|
|
56
56
|
case "python":
|
57
57
|
return cls.model_validate(data, **kw)
|
58
58
|
case "json":
|
59
|
-
|
59
|
+
if isinstance(data, str):
|
60
|
+
data = orjson.loads(data)
|
61
|
+
return cls.model_validate(data, **kw)
|
60
62
|
case "db":
|
61
63
|
if "node_metadata" in data:
|
62
64
|
data["metadata"] = data.pop("node_metadata")
|
@@ -83,7 +85,7 @@ class HashableModel(BaseModel):
|
|
83
85
|
cls, data: bytes | str, mode: ConversionMode = "json", **kwargs
|
84
86
|
) -> Self:
|
85
87
|
"""Creates an instance of this class from a JSON string."""
|
86
|
-
return cls.from_dict(
|
88
|
+
return cls.from_dict(data, mode=mode, **kwargs)
|
87
89
|
|
88
90
|
def __hash__(self):
|
89
91
|
return ln.hash_dict(self.to_dict())
|
lionagi/models/model_params.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Copyright (c) 2023
|
2
|
-
#
|
1
|
+
# Copyright (c) 2023-2025, HaiyangLi <quantocean.li at gmail dot com>
|
3
2
|
# SPDX-License-Identifier: Apache-2.0
|
4
3
|
|
5
4
|
"""ModelParams implementation using Params base class with aggressive caching.
|
lionagi/models/operable_model.py
CHANGED
lionagi/models/schema_model.py
CHANGED
lionagi/operations/__init__.py
CHANGED
lionagi/operations/_act/act.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Copyright (c) 2023
|
2
|
-
#
|
1
|
+
# Copyright (c) 2023-2025, HaiyangLi <quantocean.li at gmail dot com>
|
3
2
|
# SPDX-License-Identifier: Apache-2.0
|
4
3
|
|
5
4
|
PROMPT = """Perform a brainstorm session. Generate {num_instruct} concise and distinct instructions (Instruct), each representing a potential next step. We will run them in parallel under the same context. Ensure each idea:
|
lionagi/operations/builder.py
CHANGED
lionagi/operations/chat/chat.py
CHANGED
lionagi/operations/flow.py
CHANGED
lionagi/operations/plan/plan.py
CHANGED
lionagi/operations/types.py
CHANGED
lionagi/operations/utils.py
CHANGED
lionagi/protocols/__init__.py
CHANGED
lionagi/protocols/_concepts.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Copyright (c) 2023
|
2
|
-
#
|
1
|
+
# Copyright (c) 2023-2025, HaiyangLi <quantocean.li at gmail dot com>
|
3
2
|
# SPDX-License-Identifier: Apache-2.0
|
4
3
|
|
5
4
|
import asyncio
|
@@ -116,29 +115,13 @@ class FunctionCalling(Event):
|
|
116
115
|
self.execution.status = EventStatus.FAILED
|
117
116
|
self.execution.error = str(e)
|
118
117
|
|
119
|
-
def
|
120
|
-
"""Returns a string representation of the function call.
|
121
|
-
|
122
|
-
Returns:
|
123
|
-
A string in the format "function_name(arguments)".
|
124
|
-
"""
|
125
|
-
return f"{self.func_tool.function}({self.arguments})"
|
126
|
-
|
127
|
-
def __repr__(self) -> str:
|
128
|
-
"""Returns a detailed string representation of the function call.
|
129
|
-
|
130
|
-
Returns:
|
131
|
-
A string containing the class name and key attributes.
|
132
|
-
"""
|
133
|
-
return f"FunctionCalling(function={self.func_tool.function}, arguments={self.arguments})"
|
134
|
-
|
135
|
-
def to_dict(self) -> dict[str, Any]:
|
118
|
+
def to_dict(self, *args, **kw) -> dict[str, Any]:
|
136
119
|
"""Convert instance to dictionary.
|
137
120
|
|
138
121
|
Returns:
|
139
122
|
dict[str, Any]: Dictionary representation of the instance.
|
140
123
|
"""
|
141
|
-
dict_ = super().to_dict()
|
124
|
+
dict_ = super().to_dict(*args, **kw)
|
142
125
|
dict_["function"] = self.function
|
143
126
|
dict_["arguments"] = self.arguments
|
144
127
|
return dict_
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# Copyright (c) 2023
|
2
|
-
#
|
1
|
+
# Copyright (c) 2023-2025, HaiyangLi <quantocean.li at gmail dot com>
|
3
2
|
# SPDX-License-Identifier: Apache-2.0
|
4
3
|
|
4
|
+
import logging
|
5
5
|
from typing import Any
|
6
6
|
|
7
7
|
from lionagi.fields.action import ActionRequestModel
|
@@ -348,16 +348,46 @@ class ActionManager(Manager):
|
|
348
348
|
if request_options and tool.name in request_options:
|
349
349
|
tool_request_options = request_options[tool.name]
|
350
350
|
|
351
|
+
# Extract schema from FastMCP tool and convert to lionagi format
|
352
|
+
tool_schema = None
|
351
353
|
try:
|
352
|
-
|
354
|
+
if (
|
355
|
+
hasattr(tool, "inputSchema")
|
356
|
+
and tool.inputSchema is not None
|
357
|
+
and isinstance(tool.inputSchema, dict)
|
358
|
+
):
|
359
|
+
tool_schema = {
|
360
|
+
"type": "function",
|
361
|
+
"function": {
|
362
|
+
"name": tool.name,
|
363
|
+
"description": (
|
364
|
+
tool.description
|
365
|
+
if hasattr(tool, "description")
|
366
|
+
else None
|
367
|
+
),
|
368
|
+
"parameters": tool.inputSchema,
|
369
|
+
},
|
370
|
+
}
|
371
|
+
except Exception as schema_error:
|
372
|
+
# If schema extraction fails, let Tool auto-generate from function signature
|
373
|
+
logging.warning(
|
374
|
+
f"Could not extract schema for {tool.name}: {schema_error}"
|
375
|
+
)
|
376
|
+
tool_schema = None
|
377
|
+
|
378
|
+
try:
|
379
|
+
# Create tool with auto-populated schema from MCP discovery
|
353
380
|
tool_obj = Tool(
|
354
381
|
mcp_config=mcp_config,
|
355
382
|
request_options=tool_request_options,
|
383
|
+
tool_schema=tool_schema,
|
356
384
|
)
|
357
385
|
self.register_tool(tool_obj, update=update)
|
358
386
|
registered_tools.append(tool.name)
|
359
387
|
except Exception as e:
|
360
|
-
|
388
|
+
logging.warning(
|
389
|
+
f"Failed to register tool {tool.name}: {e}"
|
390
|
+
)
|
361
391
|
|
362
392
|
return registered_tools
|
363
393
|
|
lionagi/protocols/action/tool.py
CHANGED