mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Rename code tool arg previous_iteration_history' to
context'
This commit is contained in:
parent
06aeca2670
commit
d865994062
3 changed files with 10 additions and 10 deletions
|
@ -903,10 +903,12 @@ For example:
|
|||
{{"codes": ["print('Hello, World!')", "print('Goodbye, World!')"]}}
|
||||
|
||||
Now it's your turn to construct python programs to answer the user's question. Provide them as a list of strings in a JSON object. Do not say anything else.
|
||||
Data from Previous Iterations:
|
||||
{previous_iterations_history}
|
||||
Context:
|
||||
---
|
||||
{context}
|
||||
|
||||
Chat History:
|
||||
---
|
||||
{chat_history}
|
||||
|
||||
User: {query}
|
||||
|
|
|
@ -28,7 +28,7 @@ SANDBOX_URL = os.getenv("KHOJ_TERRARIUM_URL", "http://localhost:8080")
|
|||
async def run_code(
|
||||
query: str,
|
||||
conversation_history: dict,
|
||||
previous_iterations_history: str,
|
||||
context: str,
|
||||
location_data: LocationData,
|
||||
user: KhojUser,
|
||||
send_status_func: Optional[Callable] = None,
|
||||
|
@ -46,7 +46,7 @@ async def run_code(
|
|||
codes = await generate_python_code(
|
||||
query,
|
||||
conversation_history,
|
||||
previous_iterations_history,
|
||||
context,
|
||||
location_data,
|
||||
user,
|
||||
query_images,
|
||||
|
@ -75,7 +75,7 @@ async def run_code(
|
|||
async def generate_python_code(
|
||||
q: str,
|
||||
conversation_history: dict,
|
||||
previous_iterations_history: str,
|
||||
context: str,
|
||||
location_data: LocationData,
|
||||
user: KhojUser,
|
||||
query_images: List[str] = None,
|
||||
|
@ -96,7 +96,7 @@ async def generate_python_code(
|
|||
current_date=utc_date,
|
||||
query=q,
|
||||
chat_history=chat_history,
|
||||
previous_iterations_history=previous_iterations_history,
|
||||
context=context,
|
||||
location=location,
|
||||
username=username,
|
||||
personality_context=personality_context,
|
||||
|
|
|
@ -986,13 +986,11 @@ async def chat(
|
|||
## Gather Code Results
|
||||
if ConversationCommand.Code in conversation_commands and pending_research:
|
||||
try:
|
||||
previous_iteration_history = (
|
||||
f"# Iteration 1:\n#---\nNotes:\n{compiled_references}\n\nOnline Results:{online_results}"
|
||||
)
|
||||
context = f"# Iteration 1:\n#---\nNotes:\n{compiled_references}\n\nOnline Results:{online_results}"
|
||||
async for result in run_code(
|
||||
defiltered_query,
|
||||
meta_log,
|
||||
previous_iteration_history,
|
||||
context,
|
||||
location,
|
||||
user,
|
||||
partial(send_event, ChatEvent.STATUS),
|
||||
|
|
Loading…
Reference in a new issue