|
31 | 31 | KGCL_SCHEMA,
|
32 | 32 | OLLAMA_PROVIDER,
|
33 | 33 | ONTOLOGIES_AS_DOC_MAP,
|
34 |
| - ONTOLOGIES_URL, |
35 |
| - # ONTODIFF_DOCS, |
36 | 34 | OPENAI_KEY,
|
37 | 35 | OPENAI_PROVIDER,
|
38 | 36 | VECTOR_DB_NAME,
|
@@ -339,30 +337,23 @@ def _chunk_list(lst, chunk_size):
|
339 | 337 | tools = [tool, compress_iri]
|
340 | 338 | template = get_issue_analyzer_template()
|
341 | 339 | react_agent = create_react_agent(llm=llm, tools=tools, prompt=template)
|
342 |
| - agent_executor = AgentExecutor(agent=react_agent, tools=tools, handle_parsing_errors=True, verbose=True) |
| 340 | + agent_executor = AgentExecutor( |
| 341 | + agent=react_agent, |
| 342 | + tools=tools, |
| 343 | + handle_parsing_errors=True, |
| 344 | + verbose=True, |
| 345 | + return_intermediate_steps=True, |
| 346 | + ) |
343 | 347 | logger.info("Agent executor created successfully.")
|
344 |
| - |
345 | 348 | return agent_executor.invoke(
|
346 | 349 | {
|
347 | 350 | "input": prompt,
|
348 | 351 | "grammar": grammar["lark"],
|
349 | 352 | "explanation": grammar["explanation"],
|
350 |
| - "ontology_urls": ONTOLOGIES_URL, |
351 | 353 | }
|
352 | 354 | )
|
353 | 355 |
|
354 | 356 |
|
355 |
| -def augment_prompt(prompt: str): |
356 |
| - """Augment the prompt with additional information.""" |
357 |
| - return f""" |
358 |
| - Give me all relevant KGCL commands based on this request: \n\n |
359 |
| - + {prompt} + |
360 |
| - \n\n |
361 |
| - Return as a python list object which will be passed to another tool. |
362 |
| - Each element of the list should be enlosed in double quotes. |
363 |
| - """ |
364 |
| - |
365 |
| - |
366 | 357 | def extract_commands(command):
|
367 | 358 | """Extract the command from the list."""
|
368 | 359 | # Remove markdown markers
|
|
0 commit comments