mirror of
https://github.com/codelion/optillm.git
synced 2025-05-28 09:39:38 +03:00
fix prompt
This commit is contained in:
@@ -54,20 +54,16 @@ After your thinking, provide ONLY the refined strategy text, no introduction or
|
||||
|
||||
# Strategy application prompt for system prompt augmentation
|
||||
STRATEGY_APPLICATION_PROMPT = """
|
||||
## Problem-Solving Strategies
|
||||
Problem-Solving Strategies
|
||||
|
||||
The following strategies have been developed for different problem types and may help you solve the user's query effectively.
|
||||
The following strategies can help solve the user's query effectively. Use them as guidance when formulating your response:
|
||||
|
||||
These strategies represent approaches that have worked well for similar problems in the past. Consider using them as guidance when formulating your response:
|
||||
|
||||
- Review the strategies below to find approaches relevant to the current problem
|
||||
- Apply the steps and techniques from these strategies in your solution process
|
||||
- Use the reasoning patterns in the example processes as inspiration
|
||||
|
||||
These strategies can enhance your problem-solving capabilities for specific types of problems.
|
||||
- Find the strategies most relevant to the current problem
|
||||
- Apply the techniques from these strategies in your solution
|
||||
- Use the reasoning examples as a guide for your approach
|
||||
|
||||
{strategies_section}
|
||||
|
||||
Feel free to use <think>...</think> tags to work through your reasoning process before providing the final answer. This helps with complex problem-solving.
|
||||
You can use <think>...</think> tags to work through your reasoning process before providing the final answer.
|
||||
"""
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def extract_thinking(response: str) -> Tuple[str, Optional[str]]:
|
||||
def augment_system_prompt(system_prompt: str, strategies: List[Any]) -> str:
|
||||
"""
|
||||
Augment the system prompt with selected strategies and reasoning examples.
|
||||
Uses a directive prompt to explicitly instruct the LLM to apply the strategies.
|
||||
Instructs the LLM to apply the strategies in its solution.
|
||||
|
||||
Args:
|
||||
system_prompt: The original system prompt
|
||||
@@ -59,14 +59,14 @@ def augment_system_prompt(system_prompt: str, strategies: List[Any]) -> str:
|
||||
strategies_section = ""
|
||||
|
||||
for i, strategy in enumerate(strategies, 1):
|
||||
strategies_section += f"### Strategy {i} for {strategy.problem_type} problems\n{strategy.strategy_text}\n\n"
|
||||
strategies_section += f"Strategy {i} for {strategy.problem_type} problems:\n{strategy.strategy_text}\n\n"
|
||||
|
||||
# Add a sample reasoning example if available
|
||||
if strategy.reasoning_examples:
|
||||
# Use the most recent reasoning example (last one)
|
||||
reasoning = strategy.reasoning_examples[-1]
|
||||
if reasoning:
|
||||
strategies_section += f"#### Example reasoning process:\n<think>\n{reasoning}\n</think>\n\n"
|
||||
strategies_section += f"Example reasoning process:\n<think>\n{reasoning}\n</think>\n\n"
|
||||
|
||||
# Format the application prompt with the strategies section
|
||||
strategy_prompt = STRATEGY_APPLICATION_PROMPT.format(strategies_section=strategies_section)
|
||||
|
||||
Reference in New Issue
Block a user