Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/llm_responses' into feat/ll…
Browse files Browse the repository at this point in the history
…m_responses
  • Loading branch information
NotBioWaste905 committed Nov 13, 2024
2 parents 23d6a31 + 2d4998c commit ef9baa3
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions chatsky/slots/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,11 @@ async def get_value(self, ctx: Context) -> ExtractedGroupSlot:
result_json = result.model_dump()
logger.debug(f"Result JSON: {result_json}")

if self.allow_partially_extracted:
res = {
name: ExtractedValueSlot.model_construct(is_slot_extracted=True, extracted_value=result_json[name])
for name in result_json
if result_json[name] is not None
}
else:
res = {
name: ExtractedValueSlot.model_construct(is_slot_extracted=True, extracted_value=result_json[name])
for name in result_json
}
res = {
name: ExtractedValueSlot.model_construct(is_slot_extracted=True, extracted_value=result_json[name])
for name in result_json
if result_json[name] is not None or not self.allow_partial_extraction
}
return ExtractedGroupSlot(**res)

def __flatten_llm_group_slot(self, slot, parent_key=""):
Expand Down

0 comments on commit ef9baa3

Please sign in to comment.