mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-18 20:05:13 +02:00
Tool services - dynamically pluggable tool implementations for agent frameworks (#658)
* New schema * Tool service implementation * Base class * Joke service, for testing * Update unit tests for tool services
This commit is contained in:
parent
0b83c08ae4
commit
a38ca9474f
13 changed files with 1396 additions and 45 deletions
|
|
@ -12,4 +12,5 @@ from .structured_query import *
|
|||
from .rows_query import *
|
||||
from .diagnosis import *
|
||||
from .collection import *
|
||||
from .storage import *
|
||||
from .storage import *
|
||||
from .tool_service import *
|
||||
25
trustgraph-base/trustgraph/schema/services/tool_service.py
Normal file
25
trustgraph-base/trustgraph/schema/services/tool_service.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from ..core.primitives import Error
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToolServiceRequest:
|
||||
"""Request to a dynamically configured tool service."""
|
||||
# User context for multi-tenancy
|
||||
user: str = ""
|
||||
# Config values (collection, etc.) as JSON
|
||||
config: str = ""
|
||||
# Arguments from LLM as JSON
|
||||
arguments: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToolServiceResponse:
|
||||
"""Response from a tool service."""
|
||||
error: Error | None = None
|
||||
# Response text (the observation)
|
||||
response: str = ""
|
||||
# End of stream marker for streaming responses
|
||||
end_of_stream: bool = False
|
||||
Loading…
Add table
Add a link
Reference in a new issue