mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 21:27:53 -05:00
Merge pull request #211 from Pythagora-io/fix/210-dont-save-bad-response
Fix for #210 - dont save bad response
This commit is contained in:
@@ -51,6 +51,7 @@ class AgentConvo:
|
||||
# craft message
|
||||
self.construct_and_add_message_from_prompt(prompt_path, prompt_data)
|
||||
|
||||
# TODO: move this if block (and the other below) to Developer agent - https://github.com/Pythagora-io/gpt-pilot/issues/91#issuecomment-1751964079
|
||||
# check if we already have the LLM response saved
|
||||
if self.agent.__class__.__name__ == 'Developer':
|
||||
self.agent.project.llm_req_num += 1
|
||||
@@ -80,7 +81,8 @@ class AgentConvo:
|
||||
save_development_step(self.agent.project, prompt_path, prompt_data, self.messages, '', str(e))
|
||||
raise e
|
||||
|
||||
if self.agent.__class__.__name__ == 'Developer':
|
||||
# TODO: move this code to Developer agent - https://github.com/Pythagora-io/gpt-pilot/issues/91#issuecomment-1751964079
|
||||
if response != {} and self.agent.__class__.__name__ == 'Developer':
|
||||
development_step = save_development_step(self.agent.project, prompt_path, prompt_data, self.messages, response)
|
||||
|
||||
# TODO handle errors from OpenAI
|
||||
|
||||
Reference in New Issue
Block a user