Skip to content

data class from natural language, repetitive asking until every field is filled #5

@serkancancaglayan

Description

@serkancancaglayan
@nlp
@dataclass
class Person:
    """Extract personal info"""

    name: str
    age: int

person = Person.from_natural_language("Hi i am serkan.")
    
print(person)

The code above throws the exception openai_functions.exceptions.BrokenSchemaError: 'OpenAI returned a response that did not match the schema: None does not match {'type': 'integer'} or hallucinates empty fields. I want the code to repeatedly prompt the user to fill in all the fields.

Is it achievable with this library ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions