quantalogic 0.2.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 +20 -0
- quantalogic/agent.py +638 -0
- quantalogic/agent_config.py +138 -0
- quantalogic/coding_agent.py +83 -0
- quantalogic/event_emitter.py +223 -0
- quantalogic/generative_model.py +226 -0
- quantalogic/interactive_text_editor.py +190 -0
- quantalogic/main.py +185 -0
- quantalogic/memory.py +217 -0
- quantalogic/model_names.py +19 -0
- quantalogic/print_event.py +66 -0
- quantalogic/prompts.py +99 -0
- quantalogic/server/__init__.py +3 -0
- quantalogic/server/agent_server.py +633 -0
- quantalogic/server/models.py +60 -0
- quantalogic/server/routes.py +117 -0
- quantalogic/server/state.py +199 -0
- quantalogic/server/static/js/event_visualizer.js +430 -0
- quantalogic/server/static/js/quantalogic.js +571 -0
- quantalogic/server/templates/index.html +134 -0
- quantalogic/tool_manager.py +68 -0
- quantalogic/tools/__init__.py +46 -0
- quantalogic/tools/agent_tool.py +88 -0
- quantalogic/tools/download_http_file_tool.py +64 -0
- quantalogic/tools/edit_whole_content_tool.py +70 -0
- quantalogic/tools/elixir_tool.py +240 -0
- quantalogic/tools/execute_bash_command_tool.py +116 -0
- quantalogic/tools/input_question_tool.py +57 -0
- quantalogic/tools/language_handlers/__init__.py +21 -0
- quantalogic/tools/language_handlers/c_handler.py +33 -0
- quantalogic/tools/language_handlers/cpp_handler.py +33 -0
- quantalogic/tools/language_handlers/go_handler.py +33 -0
- quantalogic/tools/language_handlers/java_handler.py +37 -0
- quantalogic/tools/language_handlers/javascript_handler.py +42 -0
- quantalogic/tools/language_handlers/python_handler.py +29 -0
- quantalogic/tools/language_handlers/rust_handler.py +33 -0
- quantalogic/tools/language_handlers/scala_handler.py +33 -0
- quantalogic/tools/language_handlers/typescript_handler.py +42 -0
- quantalogic/tools/list_directory_tool.py +123 -0
- quantalogic/tools/llm_tool.py +119 -0
- quantalogic/tools/markitdown_tool.py +105 -0
- quantalogic/tools/nodejs_tool.py +515 -0
- quantalogic/tools/python_tool.py +469 -0
- quantalogic/tools/read_file_block_tool.py +140 -0
- quantalogic/tools/read_file_tool.py +79 -0
- quantalogic/tools/replace_in_file_tool.py +300 -0
- quantalogic/tools/ripgrep_tool.py +353 -0
- quantalogic/tools/search_definition_names.py +419 -0
- quantalogic/tools/task_complete_tool.py +35 -0
- quantalogic/tools/tool.py +146 -0
- quantalogic/tools/unified_diff_tool.py +387 -0
- quantalogic/tools/write_file_tool.py +97 -0
- quantalogic/utils/__init__.py +17 -0
- quantalogic/utils/ask_user_validation.py +12 -0
- quantalogic/utils/download_http_file.py +77 -0
- quantalogic/utils/get_coding_environment.py +15 -0
- quantalogic/utils/get_environment.py +26 -0
- quantalogic/utils/get_quantalogic_rules_content.py +19 -0
- quantalogic/utils/git_ls.py +121 -0
- quantalogic/utils/read_file.py +54 -0
- quantalogic/utils/read_http_text_content.py +101 -0
- quantalogic/xml_parser.py +242 -0
- quantalogic/xml_tool_parser.py +99 -0
- quantalogic-0.2.0.dist-info/LICENSE +201 -0
- quantalogic-0.2.0.dist-info/METADATA +1034 -0
- quantalogic-0.2.0.dist-info/RECORD +68 -0
- quantalogic-0.2.0.dist-info/WHEEL +4 -0
- quantalogic-0.2.0.dist-info/entry_points.txt +3 -0
quantalogic/prompts.py
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
def system_prompt(tools: str, environment: str, expertise: str = ""):
|
2
|
+
"""System prompt for the ReAct chatbot."""
|
3
|
+
return f"""
|
4
|
+
### Core Identity
|
5
|
+
You are QuantaLogic, an advanced ReAct AI Agent specialized in systematic problem-solving.
|
6
|
+
|
7
|
+
### Specific Expertise
|
8
|
+
{expertise}
|
9
|
+
|
10
|
+
### Task Format
|
11
|
+
Tasks will be presented within XML tags:
|
12
|
+
<task>task_description</task>
|
13
|
+
|
14
|
+
### Response Protocol
|
15
|
+
Every response must contain exactly two XML blocks:
|
16
|
+
|
17
|
+
Be very concise and precise in the <thinking> block
|
18
|
+
|
19
|
+
1. Analysis Block:
|
20
|
+
```xml
|
21
|
+
<thinking>
|
22
|
+
<task_analysis_if_no_history>
|
23
|
+
Only if no conversation history:
|
24
|
+
* Restate the main objective of the <task> and its context
|
25
|
+
* If not previously defined, clarify detailed criteria for task completion.
|
26
|
+
* Identify key components, constraints, and potential challenges.
|
27
|
+
* Break down complex tasks into concrete sub-tasks.
|
28
|
+
</task_analysis_if_no_history>
|
29
|
+
<success_criteria_if_no_history>
|
30
|
+
If no conversation history:
|
31
|
+
* Specify measurable outcomes for task completion.
|
32
|
+
* Define explicit quality benchmarks and performance indicators.
|
33
|
+
* Note any constraints or limitations that may affect the task.
|
34
|
+
</success_criteria_if_no_history>
|
35
|
+
<strategic_approach_if_no_history>
|
36
|
+
If no conversation history:
|
37
|
+
* Lay out a clear, high-level strategy for solving the task.
|
38
|
+
* Identify required resources, tools, or information.
|
39
|
+
* Anticipate possible roadblocks and outline contingency plans.
|
40
|
+
</strategic_approach_if_no_history>
|
41
|
+
<last_observation>
|
42
|
+
<!-- if there is a conversation history -->
|
43
|
+
<variable>
|
44
|
+
<name> ... variable name ... </name>
|
45
|
+
<description> ... concise description ... </description>
|
46
|
+
</variable>
|
47
|
+
<result>
|
48
|
+
... concise description ...
|
49
|
+
How this result help to the progress of the task or the problem?
|
50
|
+
</result>
|
51
|
+
</last_observation>
|
52
|
+
<progess_analysis>
|
53
|
+
* Detail each step failed and completed so far.
|
54
|
+
* Identify and evaluate any blockers or challenges to the progress of global task.
|
55
|
+
* Provide potential solutions, and if needed, suggest reevaluating the approach and the plan.
|
56
|
+
</progess_analysis>
|
57
|
+
<variables>
|
58
|
+
* List all variable names and concisely describe their current values.
|
59
|
+
</variables>
|
60
|
+
<next_steps>
|
61
|
+
* Outline immediate actions required.
|
62
|
+
* Justify tool selection and parameter choices.
|
63
|
+
* Think about variable interpolation to minimize generation of tokens.
|
64
|
+
* Consider alternatives if previous attempts were unsuccessful.
|
65
|
+
</next_steps>
|
66
|
+
<taskpad>
|
67
|
+
<note>Use this to record notes about intermediate steps.</note>
|
68
|
+
</taskpad>
|
69
|
+
</thinking>
|
70
|
+
```
|
71
|
+
|
72
|
+
2. Action Block:
|
73
|
+
```xml
|
74
|
+
<tool_name>
|
75
|
+
<parameter1>value1</parameter1>
|
76
|
+
<parameter2>value2</parameter2>
|
77
|
+
</tool_name>
|
78
|
+
```
|
79
|
+
|
80
|
+
### Tool Usage Guidelines
|
81
|
+
1. Before Repeating a Tool Call:
|
82
|
+
- Review previous results in detail.
|
83
|
+
- State why a repeat is needed.
|
84
|
+
- Adjust parameters if necessary.
|
85
|
+
- Consider whether other tools are more appropriate.
|
86
|
+
- Use variable interpolation to pass context to minimize generation of tokens, example: <toolname>$var1$<</toolname>
|
87
|
+
|
88
|
+
2. When Tool Calls Fail:
|
89
|
+
- Examine the error message carefully.
|
90
|
+
- Adjust parameters if needed.
|
91
|
+
- Consider alternative tools.
|
92
|
+
- Break down complex processes into smaller steps if necessary.
|
93
|
+
|
94
|
+
### Available Tools
|
95
|
+
{tools}
|
96
|
+
|
97
|
+
### Environment Details
|
98
|
+
{environment}
|
99
|
+
"""
|