helpers
Class info¶
🛈 DocStrings¶
Prepare LLM output to be in proper shape and executable.
tools_to_codegen
¶
Create a ToolsetCodeGenerator from a sequence of Tools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
Sequence[Tool]
|
Tools to generate code for |
required |
include_docstrings
|
bool
|
Include function docstrings in documentation |
True
|
Returns:
| Type | Description |
|---|---|
ToolsetCodeGenerator
|
ToolsetCodeGenerator instance |
Source code in src/llmling_agent/resource_providers/codemode/helpers.py
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 | |
validate_code
¶
validate_code(python_code: str) -> None
Validate code structure and raise ModelRetry for fixable issues.
Source code in src/llmling_agent/resource_providers/codemode/helpers.py
21 22 23 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 | |