Skip to content

Commit

Permalink
Update code.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emmalin-7 authored Jun 24, 2024
1 parent df4074e commit a438d04
Showing 1 changed file with 12 additions and 38 deletions.
50 changes: 12 additions & 38 deletions agential/cog/strategies/critic/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,17 @@
class CriticPydanticOutput(BaseModel):
"""Critic output
Attributes:
For "qa" mode:
answer (str): The answer generated by the agent.
critique (str): The critique of the answer generated by the agent.
query (str): The query requested by the agent.
search_result (str): The search result requested by the agent.
revised_answer (str): The revised answer generated by the agent.
For "math" mode:
code (int/str?): The code generated by the agent.
code (str): The code generated by the agent.
critique (str): The critique of the answer generated by the agent.
If use_interpreter_tool == True:
execution_status (str): The execution status of the agent.
code_answer (int/str?): The code answer generated by the agent.
improved_code (int/str?): The improved code generated by the agent.
For "code" mode:
code (int/str?): The code generated by the agent.
critique (str): The critique of the answer generated by the agent.
if use_interpreter_tool == True:
execution_status (str): The execution status of the agent.
improved_code (int/str?): The improved code generated by the agent.
"""

answer: str = Field(..., description = "The answer generated by the agent.")
critique : str = Field(..., description = "The critique of the answer generated by the agent.")
query: str = Field(..., description = "The query requested by the agent. ")
search_result: str = Field(..., description = "The search result requested by the agent.")
revised_answer: str = Field(..., description = "The revised answer generated by the agent. ")
improved_code (str): The improved code generated by the agent.
"""

code: int/str? = Field(..., description = "The code generated by the agent.")
code: str = Field(..., description = "The code generated by the agent.")
critique: str = Field(..., description = " The critique of the answer generated by the agent.")

execution_status: str = Field(..., description = "The execution status of the agent.")
code_answer: int/str? = Field(..., description = "The code answer generated by the agent.")
improved_code: int/str? = Field(..., description = "The improved code generated by the agent.")
improved_code: str = Field(..., description = "The improved code generated by the agent.")



Expand Down Expand Up @@ -94,19 +70,17 @@ def generate_pydantic_output(
) -> CriticPydanticOutput:
"""Creates a pydantic model of the output.
Args:
answer (str): The answer generated by the agent.
code (str): The code generated by the agent.
critique (str): The critique of the answer generated by the agent.
query (str): The query requested by the agent.
search_result (str): The search result requested by the agent.
revised_answer (str): The revised answer generated by the agent.
execution_status (str): The execution status of the agent.
improved_code (str): The improved code generated by the agent.
"""

return CriticPydanticOutput(
answer=answer,
code=code,
critique=critique,
query=query,
search_result=search_result,
revised_answer=revised_answer,
execution_status=execution_status,
improved_code=improved_code,
)

def generate_critique(
Expand Down

0 comments on commit a438d04

Please sign in to comment.