Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
serkancancaglayan opened this issue Dec 10, 2024 · 0 comments

Comments

@serkancancaglayan
Copy link

serkancancaglayan commented Dec 10, 2024

@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 ?

@serkancancaglayan serkancancaglayan changed the title Pydantic from natural language, repetitive asking until every field is filled data class from natural language, repetitive asking until every field is filled Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant