quantalogic 0.35.0__py3-none-any.whl → 0.40.0__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.
- quantalogic/__init__.py +0 -4
- quantalogic/agent.py +603 -363
- quantalogic/agent_config.py +233 -46
- quantalogic/agent_factory.py +34 -22
- quantalogic/coding_agent.py +16 -14
- quantalogic/config.py +2 -1
- quantalogic/console_print_events.py +4 -8
- quantalogic/console_print_token.py +2 -2
- quantalogic/docs_cli.py +15 -10
- quantalogic/event_emitter.py +258 -83
- quantalogic/flow/__init__.py +23 -0
- quantalogic/flow/flow.py +595 -0
- quantalogic/flow/flow_extractor.py +672 -0
- quantalogic/flow/flow_generator.py +89 -0
- quantalogic/flow/flow_manager.py +407 -0
- quantalogic/flow/flow_manager_schema.py +169 -0
- quantalogic/flow/flow_yaml.md +419 -0
- quantalogic/generative_model.py +109 -77
- quantalogic/get_model_info.py +5 -5
- quantalogic/interactive_text_editor.py +100 -73
- quantalogic/main.py +17 -21
- quantalogic/model_info_list.py +3 -3
- quantalogic/model_info_litellm.py +14 -14
- quantalogic/prompts.py +2 -1
- quantalogic/{llm.py → quantlitellm.py} +29 -39
- quantalogic/search_agent.py +4 -4
- quantalogic/server/models.py +4 -1
- quantalogic/task_file_reader.py +5 -5
- quantalogic/task_runner.py +20 -20
- quantalogic/tool_manager.py +10 -21
- quantalogic/tools/__init__.py +98 -68
- quantalogic/tools/composio/composio.py +416 -0
- quantalogic/tools/{generate_database_report_tool.py → database/generate_database_report_tool.py} +4 -9
- quantalogic/tools/database/sql_query_tool_advanced.py +261 -0
- quantalogic/tools/document_tools/markdown_to_docx_tool.py +620 -0
- quantalogic/tools/document_tools/markdown_to_epub_tool.py +438 -0
- quantalogic/tools/document_tools/markdown_to_html_tool.py +362 -0
- quantalogic/tools/document_tools/markdown_to_ipynb_tool.py +319 -0
- quantalogic/tools/document_tools/markdown_to_latex_tool.py +420 -0
- quantalogic/tools/document_tools/markdown_to_pdf_tool.py +623 -0
- quantalogic/tools/document_tools/markdown_to_pptx_tool.py +319 -0
- quantalogic/tools/duckduckgo_search_tool.py +2 -4
- quantalogic/tools/finance/alpha_vantage_tool.py +440 -0
- quantalogic/tools/finance/ccxt_tool.py +373 -0
- quantalogic/tools/finance/finance_llm_tool.py +387 -0
- quantalogic/tools/finance/google_finance.py +192 -0
- quantalogic/tools/finance/market_intelligence_tool.py +520 -0
- quantalogic/tools/finance/technical_analysis_tool.py +491 -0
- quantalogic/tools/finance/tradingview_tool.py +336 -0
- quantalogic/tools/finance/yahoo_finance.py +236 -0
- quantalogic/tools/git/bitbucket_clone_repo_tool.py +181 -0
- quantalogic/tools/git/bitbucket_operations_tool.py +326 -0
- quantalogic/tools/git/clone_repo_tool.py +189 -0
- quantalogic/tools/git/git_operations_tool.py +532 -0
- quantalogic/tools/google_packages/google_news_tool.py +480 -0
- quantalogic/tools/grep_app_tool.py +123 -186
- quantalogic/tools/{dalle_e.py → image_generation/dalle_e.py} +37 -27
- quantalogic/tools/jinja_tool.py +6 -10
- quantalogic/tools/language_handlers/__init__.py +22 -9
- quantalogic/tools/list_directory_tool.py +131 -42
- quantalogic/tools/llm_tool.py +45 -15
- quantalogic/tools/llm_vision_tool.py +59 -7
- quantalogic/tools/markitdown_tool.py +17 -5
- quantalogic/tools/nasa_packages/models.py +47 -0
- quantalogic/tools/nasa_packages/nasa_apod_tool.py +232 -0
- quantalogic/tools/nasa_packages/nasa_neows_tool.py +147 -0
- quantalogic/tools/nasa_packages/services.py +82 -0
- quantalogic/tools/presentation_tools/presentation_llm_tool.py +396 -0
- quantalogic/tools/product_hunt/product_hunt_tool.py +258 -0
- quantalogic/tools/product_hunt/services.py +63 -0
- quantalogic/tools/rag_tool/__init__.py +48 -0
- quantalogic/tools/rag_tool/document_metadata.py +15 -0
- quantalogic/tools/rag_tool/query_response.py +20 -0
- quantalogic/tools/rag_tool/rag_tool.py +566 -0
- quantalogic/tools/rag_tool/rag_tool_beta.py +264 -0
- quantalogic/tools/read_html_tool.py +24 -38
- quantalogic/tools/replace_in_file_tool.py +10 -10
- quantalogic/tools/safe_python_interpreter_tool.py +10 -24
- quantalogic/tools/search_definition_names.py +2 -2
- quantalogic/tools/sequence_tool.py +14 -23
- quantalogic/tools/sql_query_tool.py +17 -19
- quantalogic/tools/tool.py +39 -15
- quantalogic/tools/unified_diff_tool.py +1 -1
- quantalogic/tools/utilities/csv_processor_tool.py +234 -0
- quantalogic/tools/utilities/download_file_tool.py +179 -0
- quantalogic/tools/utilities/mermaid_validator_tool.py +661 -0
- quantalogic/tools/utils/__init__.py +1 -4
- quantalogic/tools/utils/create_sample_database.py +24 -38
- quantalogic/tools/utils/generate_database_report.py +74 -82
- quantalogic/tools/wikipedia_search_tool.py +17 -21
- quantalogic/utils/ask_user_validation.py +1 -1
- quantalogic/utils/async_utils.py +35 -0
- quantalogic/utils/check_version.py +3 -5
- quantalogic/utils/get_all_models.py +2 -1
- quantalogic/utils/git_ls.py +21 -7
- quantalogic/utils/lm_studio_model_info.py +9 -7
- quantalogic/utils/python_interpreter.py +113 -43
- quantalogic/utils/xml_utility.py +178 -0
- quantalogic/version_check.py +1 -1
- quantalogic/welcome_message.py +7 -7
- quantalogic/xml_parser.py +0 -1
- {quantalogic-0.35.0.dist-info → quantalogic-0.40.0.dist-info}/METADATA +41 -1
- quantalogic-0.40.0.dist-info/RECORD +148 -0
- quantalogic-0.35.0.dist-info/RECORD +0 -102
- {quantalogic-0.35.0.dist-info → quantalogic-0.40.0.dist-info}/LICENSE +0 -0
- {quantalogic-0.35.0.dist-info → quantalogic-0.40.0.dist-info}/WHEEL +0 -0
- {quantalogic-0.35.0.dist-info → quantalogic-0.40.0.dist-info}/entry_points.txt +0 -0
quantalogic/utils/git_ls.py
CHANGED
@@ -29,7 +29,7 @@ def git_ls(
|
|
29
29
|
|
30
30
|
# Expand paths and get absolute path
|
31
31
|
path = Path(os.path.expanduser(directory_path)).absolute()
|
32
|
-
|
32
|
+
|
33
33
|
# Verify access to base directory
|
34
34
|
if not os.access(path, os.R_OK):
|
35
35
|
return f"==== Error: No read access to directory {path} ====\n==== End of Block ===="
|
@@ -70,10 +70,10 @@ def generate_file_tree(
|
|
70
70
|
) -> Dict:
|
71
71
|
"""Generate file tree structure."""
|
72
72
|
if current_depth > max_depth:
|
73
|
-
return
|
73
|
+
return None
|
74
74
|
|
75
75
|
if ignore_spec.match_file(path) or path.name == ".git":
|
76
|
-
return
|
76
|
+
return None
|
77
77
|
|
78
78
|
if path.is_file():
|
79
79
|
try:
|
@@ -95,16 +95,18 @@ def generate_file_tree(
|
|
95
95
|
except (PermissionError, OSError):
|
96
96
|
tree["children"].append({"name": "no access", "type": "error"})
|
97
97
|
return tree
|
98
|
+
|
98
99
|
for child in children:
|
99
100
|
if not ignore_spec.match_file(child):
|
100
101
|
if child.is_file():
|
101
102
|
child_tree = generate_file_tree(child, ignore_spec, recursive, max_depth, current_depth)
|
102
|
-
|
103
|
+
if child_tree: # Only append if not None
|
104
|
+
tree["children"].append(child_tree)
|
103
105
|
elif child.is_dir():
|
104
106
|
# Always include directories
|
105
107
|
child_tree = generate_file_tree(child, ignore_spec, recursive, max_depth, current_depth + 1)
|
106
108
|
if recursive:
|
107
|
-
if child_tree:
|
109
|
+
if child_tree: # Only append if not None
|
108
110
|
tree["children"].append(child_tree)
|
109
111
|
else:
|
110
112
|
tree["children"].append({"name": child.name, "type": "directory", "children": []})
|
@@ -114,9 +116,16 @@ def generate_file_tree(
|
|
114
116
|
|
115
117
|
def format_tree(tree: Dict, start: int, end: int) -> str:
|
116
118
|
"""Format tree structure into string output with line information."""
|
119
|
+
if not tree: # Handle empty or None tree
|
120
|
+
return "==== No files to display ===="
|
121
|
+
|
117
122
|
lines = []
|
118
123
|
_format_tree_recursive(tree, lines, 0)
|
119
124
|
total_lines = len(lines)
|
125
|
+
|
126
|
+
if total_lines == 0: # Handle case with no valid lines
|
127
|
+
return "==== No files to display ===="
|
128
|
+
|
120
129
|
is_last_block = end >= total_lines
|
121
130
|
output = "\n".join(lines[start - 1 : end])
|
122
131
|
|
@@ -129,13 +138,18 @@ def format_tree(tree: Dict, start: int, end: int) -> str:
|
|
129
138
|
|
130
139
|
def _format_tree_recursive(node: Dict, lines: List[str], depth: int):
|
131
140
|
"""Recursively format tree nodes."""
|
141
|
+
if not node or "type" not in node: # Skip invalid nodes
|
142
|
+
return
|
143
|
+
|
132
144
|
indent = " " * depth
|
133
145
|
if node["type"] == "file":
|
134
146
|
lines.append(f"{indent}📄 {node['name']} ({node['size']})")
|
135
|
-
|
147
|
+
elif node["type"] == "directory":
|
136
148
|
lines.append(f"{indent}📁 {node['name']}/")
|
137
|
-
for child in node
|
149
|
+
for child in node.get("children", []):
|
138
150
|
_format_tree_recursive(child, lines, depth + 1)
|
151
|
+
elif node["type"] == "error":
|
152
|
+
lines.append(f"{indent}❌ {node['name']}")
|
139
153
|
|
140
154
|
|
141
155
|
if __name__ == "__main__":
|
@@ -9,14 +9,17 @@ class ModelType(str, Enum):
|
|
9
9
|
EMBEDDINGS = "embeddings"
|
10
10
|
VLM = "vlm"
|
11
11
|
|
12
|
+
|
12
13
|
class CompatibilityType(str, Enum):
|
13
14
|
MLX = "mlx"
|
14
15
|
GGUF = "gguf"
|
15
16
|
|
17
|
+
|
16
18
|
class ModelState(str, Enum):
|
17
19
|
LOADED = "loaded"
|
18
20
|
NOT_LOADED = "not-loaded"
|
19
21
|
|
22
|
+
|
20
23
|
class ModelInfo(BaseModel):
|
21
24
|
id: str = Field(..., description="Unique model identifier in LM Studio's namespace")
|
22
25
|
object: Literal["model"] = Field("model", description="Always 'model' for model objects")
|
@@ -28,21 +31,20 @@ class ModelInfo(BaseModel):
|
|
28
31
|
state: ModelState = Field(..., description="Current loading state in LM Studio")
|
29
32
|
max_context_length: int = Field(..., alias="max_context_length", ge=0)
|
30
33
|
loaded_context_length: Optional[int] = Field(
|
31
|
-
None,
|
32
|
-
alias="loaded_context_length",
|
33
|
-
description="Currently allocated context length (only when loaded)",
|
34
|
-
ge=0
|
34
|
+
None, alias="loaded_context_length", description="Currently allocated context length (only when loaded)", ge=0
|
35
35
|
)
|
36
36
|
|
37
|
+
|
37
38
|
class ModelListResponse(BaseModel):
|
38
39
|
data: List[ModelInfo] = Field(..., description="List of available models")
|
39
40
|
object: Literal["list"] = Field("list", description="Always 'list' for list responses")
|
40
41
|
|
42
|
+
|
41
43
|
def get_model_list() -> ModelListResponse:
|
42
44
|
"""Fetch and validate model information from LM Studio's API"""
|
43
45
|
import requests
|
44
|
-
|
46
|
+
|
45
47
|
response = requests.get("http://localhost:1234/api/v0/models")
|
46
48
|
response.raise_for_status()
|
47
|
-
|
48
|
-
return ModelListResponse(**response.json())
|
49
|
+
|
50
|
+
return ModelListResponse(**response.json())
|