code
Class info¶
🛈 DocStrings¶
Code analysis tools.
analyze_code
async
¶
Analyze Python code complexity and structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
Python code to analyze |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing analysis metrics including: |
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
Source code in src/llmling/tools/code.py
count_tokens
async
¶
Count the approximate number of tokens in text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text to analyze |
required |
model
|
str
|
Model to use for tokenization (default: gpt-4) |
'gpt-4'
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: |
dict[str, Any]
|
|
dict[str, Any]
|
|