provider
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentContext llmling_agent.agent.context Runtime context for agent execution. |
||
| AggregatingResourceProvider llmling_agent.resource_providers.aggregating Provider that combines resources from multiple providers. |
||
| CodeModeResourceProvider llmling_agent.resource_providers.codemode.provider Provider that wraps tools into a single Python execution environment. |
||
| Tool llmling_agent.tools.base Information about a registered tool. |
🛈 DocStrings¶
Meta-resource provider that exposes tools through Python execution.
CodeModeResourceProvider
¶
Bases: AggregatingResourceProvider
Provider that wraps tools into a single Python execution environment.
Source code in src/llmling_agent/resource_providers/codemode/provider.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
__init__
¶
__init__(
providers: list[ResourceProvider],
name: str = "meta_tools",
include_docstrings: bool = True,
usage_notes: str = USAGE,
) -> None
Initialize meta provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
providers
|
list[ResourceProvider]
|
Providers whose tools to wrap |
required |
name
|
str
|
Provider name |
'meta_tools'
|
include_docstrings
|
bool
|
Include function docstrings in documentation |
True
|
usage_notes
|
str
|
Usage notes for the codemode tool |
USAGE
|
Source code in src/llmling_agent/resource_providers/codemode/provider.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
execute
async
¶
execute(ctx: AgentContext, python_code: str) -> Any
Execute Python code with all wrapped tools available as functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_code
|
str
|
Python code to execute |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Result of the last expression or explicit return value |
Source code in src/llmling_agent/resource_providers/codemode/provider.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
get_tools
async
¶
Return single meta-tool for Python execution with available tools.
Source code in src/llmling_agent/resource_providers/codemode/provider.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
invalidate_cache
¶
invalidate_cache() -> None
Invalidate cached tool when providers change.
Source code in src/llmling_agent/resource_providers/codemode/provider.py
102 103 104 | |