Closed Brandl closed 6 months ago
I have touched on this in #228, though this might be an entirely unrelated issue:
I wrote a short progam, but there are neither errors nor parsed entities in the output, so I needed to do parsing myself:
class EntityExtraction(BaseModel): name: Optional[List[str]] = Field( default=None, description="names (e.g., 'Luke Skywalker', 'Obi-Wan Kenobi')." ) location: Optional[List[str]] = Field( default=None, description="Location (e.g., 'Death Star', 'Coruscant')." ) schema, validator = from_pydantic(EntityExtraction) chain = create_extraction_chain(llm, schema, encoder_or_encoder_class="json", validator=validator) json_encoder = JSONEncoder(use_tags=True) result = chain.invoke(text_input.text) return json_encoder.decode(result['text']['raw'])
Is this a bug, or am I missing something obvious here?
I have touched on this in #228, though this might be an entirely unrelated issue:
I wrote a short progam, but there are neither errors nor parsed entities in the output, so I needed to do parsing myself:
Is this a bug, or am I missing something obvious here?