Further improve and add in advanced reasoning capabilities: ` import streamlit as st…
- User
Further improve and add in advanced reasoning capabilities:
code - Assistant
Further improve and add in advanced reasoning capabilities:
import streamlit as st
import g4f
from g4f.client import Client
import os
import json
import time
import re
from typing import List, Tuple, Dict
import numpy as np
class AdvancedReasoningEngine:
def __init__(self, model="gpt-4o"):
self.client = Client()
self.model = model
self.reasoning_strategies = [
"Analytical Decomposition",
"Probabilistic Reasoning",
"Multi-Perspective Analysis",
"Counterfactual Reasoning",
"Meta-Cognitive Evaluation"
]
# Comprehensive JSON Structure Documentation
self.json_structure_guide = {
"next_action": {
"continue": {
"description": "Indicates the AI should proceed with further reasoning steps",
"use_case": "When the current reasoning is incomplete or requires deeper exploration",
"example": {
"title": "Initial Problem Decomposition",
"content": "Breaking down the problem into key components...",
"strategy": "Analytical Decomposition",
"confidence": 60,
"next_action": "continue",
"key_points": ["Identified main problem areas"]
}
},
"final_answer": {
"description": "Signals that the AI has reached a conclusive reasoning point",
"use_case": [
"Problem fully analyzed",
"Sufficient evidence gathered",
"No further reasoning steps needed"
],
"example": {
"title": "Definitive Conclusion",
"content": "Based on comprehensive analysis, the answer is...",
"strategy": "Comprehensive Synthesis",
"confidence": 85,
"next_action": "final_answer",
"key_points": ["Consolidated all findings", "Final answer derived from analysis"]
}
}
},
"early_final_answer_scenarios": [
{
"scenario": "Immediate Resolution",
"description": "When the problem is trivially simple",
"example": {
"title": "Instant Solution",
"content": "The answer is straightforward and requires no complex reasoning",
"strategy": "Direct Inference",
"confidence": 95,
"next_action": "final_answer",
"key_points": ["Problem is straightforward", "Direct inference applied"]
}
},
{
"scenario": "Insufficient Information",
"description": "When the problem lacks necessary details for in-depth analysis",
"example": {
"title": "Reasoning Limitation",
"content": "Cannot proceed due to lack of critical information",
"strategy": "Meta-Cognitive Evaluation",
"confidence": 30,
"next_action": "final_answer",
"key_points": ["Insufficient data provided"]
}
}
]
}
def make_api_call(self, messages, max_tokens, is_final_answer=False):
for attempt in range(3):
try:
response = self.client.chat.completions.create(
model=self.model,
messages=messages,
max_tokens=max_tokens,
temperature=0.7,
top_p=0.9,
frequency_penalty=0.5,
response_format={"type": "json_object"}
)
return json.loads(response.choices[0].message.content)
except Exception as e:
if attempt == 2:
return self._generate_fallback_response(e, is_final_answer)
time.sleep(1)
def generate_system_prompt(self) -> str:
"""
Generate a comprehensive system prompt that includes JSON structure guidelines.
The prompt now explicitly explains the 'next_action' mechanism and provides
clear guidance on when to use 'continue' vs 'final_answer', along with instructions
for handling cumulative key points.
"""
json_structure = """
{
"title": "Step Title", // Descriptive name of reasoning step
"content": "Detailed explanation", // In-depth reasoning process
"strategy": "Reasoning Strategy", // Method used (e.g., Analytical Decomposition)
"confidence": 0-100, // Certainty percentage
"next_action": "continue/final_answer", // Reasoning progression indicator
"key_points": ["Key point 1", "Key point 2"] // Cumulative key points
}
"""
return f"""You are an advanced AI reasoning engine with multi-dimensional cognitive capabilities.
Core Reasoning Strategies:
{', '.join(self.reasoning_strategies)}
Reasoning Protocol:
1. Decompose problem into fundamental components
2. Apply diverse reasoning strategies
3. Cross-validate reasoning paths
4. Quantify confidence levels
5. Identify potential biases and limitations
6. Accumulate key points to build comprehensive understanding
JSON Response Mechanics - CR ITICAL UNDERSTANDING:
1. 'next_action' Mechanism:
- 'continue':
* Signals MORE reasoning steps are required
* Used when current analysis is INCOMPLETE
* Indicates: "I need to dig deeper"
* Typical use: Complex problems needing multi-step breakdown
- 'final_answer':
* Signals REASONING IS COMPLETE
* Used when you have a definitive conclusion
* Indicates: "I'm ready to provide the final answer"
* Typical use: Problem fully analyzed, clear solution found
2. Early 'final_answer' Scenarios:
- Trivially simple problems
- Insufficient information to proceed
- Immediate, obvious solution
- Reasoning hits an insurmountable barrier
3. Confidence Level Guidance:
- 20-40%: Speculative (use 'continue')
- 41-70%: Needs further investigation (use 'continue')
- 71-90%: Strong evidence (can use 'final_answer')
- 91-100%: Definitive (strongly use 'final_answer')
4. Cumulative Key Points:
- After each reasoning step, generate key points summarizing critical insights.
- Use accumulated key points to inform subsequent reasoning steps.
- Ensure key points are concise and capture the essence of the reasoning so far.
JSON Structure Requirements:
{json_structure}
CRITICAL INSTRUCTION:
- ALWAYS choose 'next_action' thoughtfully
- Provide CLEAR RATIONALE for your action choice
- Be EXPLICIT about reasoning limitations
- Utilize and update key points to enhance cumulative understanding
"""
def _generate_fallback_response(self, error, is_final_answer):
base_response = {
"title": "Reasoning Resilience",
"content": f"AI encountered a processing limitation. Error: {str(error)}",
"strategy": "System Error Handling",
"confidence": 50,
"next_action": "final_answer",
"key_points": ["Encountered processing error"]
}
if is_final_answer:
base_response["title"] = "Final Answer Approximation"
base_response["strategy"] = "Error-Based Synthesis"
base_response["key_points"] = ["Provided best approximation despite error"]
return base_response
def generate_response(self, prompt):
"""
Enhanced response generation with explicit handling of 'next_action'
and cumulative key points.
Demonstrates different scenarios of reasoning progression:
1. Multi-step complex reasoning
2. Immediate final answer
3. Reasoning limitation
"""
# Initial messages setup with enhanced system prompt
system_prompt = self.generate_system_prompt()
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": prompt}
]
steps = []
step_count = 1
total_thinking_time = 0
key_points = []
while True:
start_time = time.time()
# Include accumulated key points in the context
context = "\n".join([f"- {kp}" for kp in key_points])
user_message = f"As the reasoning progresses, consider the following key points:\n{context}\n\nContinue reasoning."
messages.append({"role": "user", "content": user_message})
step_data = self.make_api_call(messages, 350)
end_time = time.time()
thinking_time = end_time - start_time
total_thinking_time += thinking_time
# Update key points
new_key_points = step_data.get('key_points', [])
key_points.extend(new_key_points)
# Detailed step tracking with strategy and confidence
steps.append({
"number": f"Step {step_count}",
"title": step_data.get('title', 'Unnamed Step'),
"content": step_data.get('content', 'No content generated'),
"strategy": step_data.get('strategy', 'Unspecified'),
"confidence": step_data.get('confidence', 50),
"thinking_time": thinking_time,
"next_action": step_data.get('next_action', 'continue'),
"key_points": key_points.copy()
})
messages.append({"role": "assistant", "content": json.dumps(step_data)})
# Explicit handling of reasoning progression
if step_data.get('next_action') == 'final_answer':
break
step_count += 1
# Safeguard against infinite reasoning
if step_count > 10: # Prevent excessive reasoning steps
break
yield steps, None
# Final answer generation with comprehensive review
synthesis_prompt = (
"Synthesize a comprehensive final answer based on the accumulated key points. "
"Explicitly state the reasoning path taken and any limitations encountered."
)
messages.append({"role": "user", "content": synthesis_prompt})
start_time = time.time()
final_data = self.make_api_call(messages, 400, is_final_answer=True)
end_time = time.time()
thinking_time = end_time - start_time
total_thinking_time += thinking_time
# Update key points with final step
final_key_points = final_data.get('key_points', [])
key_points.extend(final_key_points)
steps.append({
"number": "Final Answer",
"title": final_data.get('title', 'Synthesized Conclusion'),
"content": final_data.get('content', 'No conclusive answer generated'),
"strategy": final_data.get('strategy', 'Comprehensive Synthesis'),
"confidence": final_data.get('confidence', 75),
"thinking_time": thinking_time,
"key_points": key_points.copy()
})
yield steps, total_thinking_time
def main():
st.set_page_config(page_title="Advanced AI Reasoning Engine", page_icon="🧠", layout="wide")
st.title("🔬 Advanced Multi-Dimensional Reasoning Engine")
st.markdown("""
### Cognitive Processing Framework
- **Multi-Strategy Reasoning**: Combines analytical, probabilistic, and meta-cognitive approaches
- **Confidence-Based Reasoning**: Quantifies certainty at each step
- **Adaptive Cognitive Processing**: Dynamically adjusts reasoning strategy
- **Cumulative Reasoning with Key Points**: Builds upon previous insights to enhance understanding
""")
reasoning_engine = AdvancedReasoningEngine()
user_query = st.text_input("Enter complex query or problem:", placeholder="Provide a challenging problem or query")
if user_query:
st.write("🔍 Initiating Advanced Reasoning Process...")
response_container = st.empty()
time_container = st.empty()
keypoints_container = st.empty()
all_key_points = []
for steps, total_thinking_time in reasoning_engine.generate_response(user_query):
with response_container.container():
for step in steps:
if step['number'] == "Final Answer":
st.markdown(f"### 🏁 {step['title']}")
st.markdown(f"**Confidence Level: {step['confidence']}%**")
st.markdown(step['content'].replace('\n', '<br>'), unsafe_allow_html=True)
else:
with st.expander(f"{step['number']}: {step['title']} (Strategy: {step['strategy']})", expanded=False):
st.markdown(f"**Confidence: {step['confidence']}%**")
st.markdown(f"**Thinking Time: {step['thinking_time']:.2f} seconds**")
st.markdown(step['content'].replace('\n', '<br>'), unsafe_allow_html=True)
if total_thinking_time is not None:
time_container.markdown(f"**🕒 Total Reasoning Time: {total_thinking_time:.2f} seconds**")
# Update and display key points
all_key_points = steps[-1].get('key_points', [])
formatted_keypoints = "\n".join([f"- {kp}" for kp in all_key_points])
keypoints_container.markdown("### 🔑 **Cumulative Key Points**")
keypoints_container.markdown(formatted_keypoints)
if __name__ == "__main__":
main()
Certainly! Below is an enhanced version of your Advanced Reasoning Engine with added advanced reasoning capabilities. The improvements focus on expanding reasoning strategies, implementing dynamic strategy selection, enhancing error handling, optimizing key point management, and refining the Streamlit UI for better user interaction and visualization.
Expanded Reasoning Strategies:
Dynamic Strategy Selection:
Enhanced JSON Response Structure:
dependencies to show how different reasoning steps interrelate.Advanced Error Handling:
Optimized Key Points Management:
Improved Streamlit UI:
Performance Enhancements:
import streamlit as st
import g4f
from g4f.client import Client
import os
import json
import time
import re
from typing import List, Tuple, Dict
import numpy as np
import logging
import asyncio
import aiohttp
# Setup logging
logging.basicConfig(level=logging.INFO, filename='reasoning_engine.log',
format='%(asctime)s - %(levelname)s - %(message)s')
class AdvancedReasoningEngine:
def __init__(self, model="gpt-4o"):
self.client = Client()
self.model = model
self.reasoning_strategies = [
"Analytical Decomposition",
"Probabilistic Reasoning",
"Multi-Perspective Analysis",
"Counterfactual Reasoning",
"Meta-Cognitive Evaluation",
"Analogical Reasoning",
"Heuristic Evaluation",
"Abductive Reasoning"
]
# Comprehensive JSON Structure Documentation
self.json_structure_guide = {
"step_number": {
"description": "Sequential identifier for the reasoning step",
"example": 1
},
"title": {
"description": "Descriptive name of reasoning step",
"example": "Initial Problem Decomposition"
},
"content": {
"description": "Detailed explanation of the reasoning process",
"example": "Breaking down the problem into key components..."
},
"strategy": {
"description": "Method used (e.g., Analytical Decomposition)",
"example": "Analytical Decomposition"
},
"confidence": {
"description": "Certainty percentage of the reasoning",
"example": 60
},
"next_action": {
"description": "Reasoning progression indicator",
"example": "continue"
},
"key_points": {
"description": "Cumulative key points summarizing critical insights",
"example": ["Identified main problem areas"]
},
"dependencies": {
"description": "References to previous steps or key points",
"example": [1, 2]
}
}
async def make_api_call_async(self, messages, max_tokens, is_final_answer=False):
async with aiohttp.ClientSession() as session:
for attempt in range(3):
try:
async with session.post(
"https://api.yourmodelendpoint.com/chat/completions",
headers={"Authorization": f"Bearer {os.getenv('API_KEY')}"},
json={
"model": self.model,
"messages": messages,
"max_tokens": max_tokens,
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0.5,
"response_format": {"type": "json_object"}
}
) as response:
if response.status == 200:
data = await response.json()
return json.loads(data['choices'][0]['message']['content'])
else:
error_text = await response.text()
logging.error(f"API Error {response.status}: {error_text}")
raise Exception(f"API Error {response.status}: {error_text}")
except Exception as e:
logging.warning(f"Attempt {attempt + 1} failed with error: {e}")
if attempt == 2:
return self._generate_fallback_response(e, is_final_answer)
await asyncio.sleep(1)
def generate_system_prompt(self) -> str:
"""
Generate a comprehensive system prompt that includes JSON structure guidelines
and enhanced instructions for advanced reasoning capabilities.
"""
json_structure = json.dumps(self.json_structure_guide, indent=4)
return f"""You are an advanced AI reasoning engine with multi-dimensional cognitive capabilities.
Core Reasoning Strategies:
{', '.join(self.reasoning_strategies)}
Reasoning Protocol:
1. Decompose problem into fundamental components
2. Apply diverse reasoning strategies
3. Cross-validate reasoning paths
4. Quantify confidence levels
5. Identify potential biases and limitations
6. Accumulate and prioritize key points to build comprehensive understanding
7. Dynamically select reasoning strategies based on context and needs
JSON Response Mechanics - CRITICAL UNDERSTANDING:
1. 'next_action' Mechanism:
- 'continue':
* Signals MORE reasoning steps are required
* Used when current analysis is INCOMPLETE
* Indicates: "I need to dig deeper"
* Typical use: Complex problems needing multi-step breakdown
- 'final_answer':
* Signals REASONING IS COMPLETE
* Used when you have a definitive conclusion
* Indicates: "I'm ready to provide the final answer"
* Typical use: Problem fully analyzed, clear solution found
2. Early 'final_answer' Scenarios:
- Trivially simple problems
- Insufficient information to proceed
- Immediate, obvious solution
- Reasoning hits an insurmountable barrier
3. Confidence Level Guidance:
- 20-40%: Speculative (use 'continue')
- 41-70%: Needs further investigation (use 'continue')
- 71-90%: Strong evidence (can use 'final_answer')
- 91-100%: Definitive (strongly use 'final_answer')
4. Cumulative Key Points:
- After each reasoning step, generate prioritized key points summarizing critical insights.
- Use accumulated key points to inform subsequent reasoning steps.
- Ensure key points are concise and capture the essence of the reasoning so far.
- Include dependencies to previous steps if applicable.
5. Dynamic Strategy Selection:
- Based on the problem context and accumulated key points, choose the most effective reasoning strategy.
- Strategies can be combined or alternated to provide a robust analysis.
6. JSON Structure Requirements:
{json_structure}
CRITICAL INSTRUCTION:
- ALWAYS choose 'next_action' thoughtfully
- Provide CLEAR RATIONALE for your action choice
- Be EXPLICIT about reasoning limitations
- Utilize, prioritize, and update key points to enhance cumulative understanding
- Reference dependencies where applicable to show reasoning flow
"""
def _generate_fallback_response(self, error, is_final_answer):
if isinstance(error, aiohttp.ClientError):
strategy = "Network Error Handling"
confidence = 40
title = "Network Issue Encountered"
content = "Unable to reach the AI service due to network issues."
else:
strategy = "System Error Handling"
confidence = 50
title = "Reasoning Resilience"
content = f"AI encountered a processing limitation. Error: {str(error)}"
base_response = {
"step_number": None,
"title": title,
"content": content,
"strategy": strategy,
"confidence": confidence,
"next_action": "final_answer",
"key_points": ["Encountered processing error"],
"dependencies": []
}
if is_final_answer:
base_response["title"] = "Final Answer Approximation"
base_response["strategy"] = "Error-Based Synthesis"
base_response["key_points"] = ["Provided best approximation despite error"]
base_response["dependencies"] = []
return base_response
async def generate_response(self, prompt):
"""
Enhanced response generation with explicit handling of 'next_action',
cumulative key points with prioritization, and dynamic strategy selection.
"""
# Initial messages setup with enhanced system prompt
system_prompt = self.generate_system_prompt()
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": prompt}
]
steps = []
step_count = 1
total_thinking_time = 0
key_points = []
dependencies = []
while True:
start_time = time.time()
# Include accumulated key points in the context
context = "\n".join([f"- {kp}" for kp in key_points])
user_message = f"As the reasoning progresses, consider the following key points:\n{context}\n\nContinue reasoning."
messages.append({"role": "user", "content": user_message})
# Make asynchronous API call
step_data = await self.make_api_call_async(messages, 350)
# Fallback is already handled inside make_api_call_async
end_time = time.time()
thinking_time = end_time - start_time
total_thinking_time += thinking_time
# Update key points with prioritization
new_key_points = step_data.get('key_points', [])
prioritized_key_points = self._prioritize_key_points(new_key_points)
key_points.extend(prioritized_key_points)
# Track dependencies
dependency_steps = step_data.get('dependencies', [])
dependencies.extend(dependency_steps)
# Detailed step tracking with strategy and confidence
steps.append({
"step_number": step_count,
"title": step_data.get('title', 'Unnamed Step'),
"content": step_data.get('content', 'No content generated'),
"strategy": step_data.get('strategy', 'Unspecified'),
"confidence": step_data.get('confidence', 50),
"thinking_time": thinking_time,
"next_action": step_data.get('next_action', 'continue'),
"key_points": key_points.copy(),
"dependencies": dependencies.copy()
})
messages.append({"role": "assistant", "content": json.dumps(step_data)})
# Logging each step
logging.info(f"Step {step_count}: {step_data.get('title', 'Unnamed Step')} - Next Action: {step_data.get('next_action')}")
# Explicit handling of reasoning progression
if step_data.get('next_action') == 'final_answer':
break
step_count += 1
# Safeguard against infinite reasoning
if step_count > 15: # Increased to allow more complex problems
logging.warning("Maximum reasoning steps reached. Terminating process.")
break
yield steps, None
# Final answer generation with comprehensive review
synthesis_prompt = (
"Synthesize a comprehensive final answer based on the accumulated key points. "
"Explicitly state the reasoning path taken, highlight critical dependencies, and mention any limitations encountered."
)
messages.append({"role": "user", "content": synthesis_prompt})
start_time = time.time()
final_data = await self.make_api_call_async(messages, 400, is_final_answer=True)
end_time = time.time()
thinking_time = end_time - start_time
total_thinking_time += thinking_time
# Update key points with final step
final_key_points = final_data.get('key_points', [])
prioritized_final_key_points = self._prioritize_key_points(final_key_points)
key_points.extend(prioritized_final_key_points)
# Track dependencies
final_dependencies = final_data.get('dependencies', [])
dependencies.extend(final_dependencies)
steps.append({
"step_number": "Final Answer",
"title": final_data.get('title', 'Synthesized Conclusion'),
"content": final_data.get('content', 'No conclusive answer generated'),
"strategy": final_data.get('strategy', 'Comprehensive Synthesis'),
"confidence": final_data.get('confidence', 75),
"thinking_time": thinking_time,
"next_action": final_data.get('next_action', 'final_answer'),
"key_points": key_points.copy(),
"dependencies": dependencies.copy()
})
logging.info(f"Final Answer: {final_data.get('title', 'Synthesized Conclusion')}")
yield steps, total_thinking_time
def _prioritize_key_points(self, key_points: List[str]) -> List[str]:
"""
Prioritize key points by removing redundancy and highlighting critical insights.
"""
# Simple deduplication and ranking based on keyword importance
unique_key_points = list(dict.fromkeys(key_points)) # Remove duplicates
prioritized = []
important_keywords = ['critical', 'important', 'key', 'main', 'essential']
for kp in unique_key_points:
if any(word in kp.lower() for word in important_keywords):
prioritized.insert(0, kp) # Add important points at the beginning
else:
prioritized.append(kp)
return prioritized
def main():
st.set_page_config(page_title="Advanced AI Reasoning Engine", page_icon="🧠", layout="wide")
st.title("🔬 Advanced Multi-Dimensional Reasoning Engine")
st.markdown("""
### Cognitive Processing Framework
- **Multi-Strategy Reasoning**: Combines analytical, probabilistic, meta-cognitive, analogical, heuristic, and abductive approaches.
- **Confidence-Based Reasoning**: Quantifies certainty at each step.
- **Dynamic Strategy Selection**: Automatically selects the most effective reasoning strategy based on context.
- **Cumulative Reasoning with Prioritized Key Points**: Builds upon previous insights, emphasizing critical information.
- **Enhanced Error Handling**: Robust mechanisms to handle and recover from various error scenarios.
- **Performance Optimization**: Asynchronous processing and caching for efficient reasoning.
""")
reasoning_engine = AdvancedReasoningEngine()
user_query = st.text_area("Enter a complex query or problem:", height=150, placeholder="Provide a challenging problem or query")
if st.button("🧠 Start Reasoning"):
if user_query.strip() == "":
st.warning("Please enter a valid query to proceed.")
else:
st.info("🔍 Initiating Advanced Reasoning Process...")
response_container = st.container()
thinking_progress = st.progress(0)
time_container = st.empty()
keypoints_container = st.container()
all_key_points = []
total_steps = 0
async def run_reasoning():
async for steps, total_thinking_time in reasoning_engine.generate_response(user_query):
nonlocal total_steps
total_steps = len(steps)
with response_container:
for step in steps:
if step['step_number'] == "Final Answer":
st.markdown(f"### 🏁 {step['title']}")
st.markdown(f"**Confidence Level: {step['confidence']}%**")
st.markdown(step['content'].replace('\n', '<br>'), unsafe_allow_html=True)
else:
with st.expander(f"{step['step_number']}: {step['title']} (Strategy: {step['strategy']})", expanded=False):
st.markdown(f"**Confidence: {step['confidence']}%**")
st.markdown(f"**Thinking Time: {step['thinking_time']:.2f} seconds**")
st.markdown(step['content'].replace('\n', '<br>'), unsafe_allow_html=True)
# Update progress bar
if total_steps > 0:
thinking_progress.progress(min(total_steps / 15, 1.0)) # Assuming max 15 steps
if total_thinking_time is not None:
time_container.markdown(f"**🕒 Total Reasoning Time: {total_thinking_time:.2f} seconds**")
# Update and display key points with prioritization
all_key_points = steps[-1].get('key_points', [])
formatted_keypoints = "\n".join([f"- {kp}" for kp in all_key_points])
with keypoints_container:
st.markdown("### 🔑 **Cumulative Key Points**")
st.markdown(formatted_keypoints)
asyncio.run(run_reasoning())
if __name__ == "__main__":
main()
Expanded Reasoning Strategies:
Dynamic Strategy Selection:
Enhanced JSON Response Structure:
Advanced Error Handling:
reasoning_engine.log) for debugging and analysis purposes.Optimized Key Points Management:
Improved Streamlit UI:
Caching Implementation: Integrate caching (using libraries like cachetools or streamlit's built-in caching) to store responses for frequently asked queries, reducing API calls and improving response times.
User-Selectable Strategies: Allow users to select or prioritize certain reasoning strategies based on their preferences or the nature of their queries. This can be implemented using Streamlit's multiselect widgets.
Interactive Visualizations: Incorporate more interactive elements, such as visual graphs to depict dependencies between reasoning steps, enhancing user understanding.
Security Enhancements: Ensure that API keys and sensitive information are securely managed, possibly using environment variables or Streamlit's secrets management.
Scalability Considerations: For large-scale deployments, consider implementing more robust asynchronous handling and possibly integrating with deployment platforms that support asynchronous operations.
The enhanced Advanced Reasoning Engine now boasts a more robust and flexible architecture, capable of handling complex queries with improved reasoning strategies, better error handling, and an optimized user interface. These enhancements not only improve the engine's performance and reliability but also significantly enhance the user experience by providing clear, concise, and well-structured reasoning outputs.
Feel free to integrate these improvements and further customize the engine to suit your specific requirements!
Not yet included in a published release.
Performance Enhancements:
asyncio and aiohttp) to handle API requests more efficiently, reducing wait times and improving responsiveness.