AIToolsLab / questions

Writer-directed questions
0 stars 0 forks source link

Try out two-stage generation, getting the JSON second. #17

Open kcarnold opened 1 year ago

kcarnold commented 1 year ago

I changed the text field name to try to discourage the model from just quoting the input text, which it was tending to do. Untested!

I'm hoping that the lower temperature for JSON generation will reduce the chance of generation failures. It would be even better to use the openai function calling mechanism; basically we'd force the model to call a function with the desired schema, and it'll generate JSON of the right format by construction.

TODO

kcarnold commented 1 year ago

Perhaps langchain would be helpful?

https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic