Skip to content

Commit

Permalink
fix: append to gleaning chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar committed Oct 12, 2024
1 parent 9e729e6 commit 8137550
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docetl/operations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ def _cached_call_llm(
response = self._call_llm_with_cache(
model, op_type, messages, output_schema, tools, scratchpad
)
parsed_output = self.parse_llm_response(
response, output_schema, tools
)[0]
validator_messages[-1] = [
{"role": "assistant", "content": json.dumps(parsed_output)},
]

total_cost += completion_cost(response)

validated = True
Expand Down

0 comments on commit 8137550

Please sign in to comment.