quackscience / duckdb-extension-openprompt

DuckDB Community Extension to prompt LLMs from SQL
https://duckdb.org/community_extensions/extensions/open_prompt.html
MIT License
24 stars 1 forks source link

Additional Parameters for Structured output #5

Closed lmangani closed 1 month ago

lmangani commented 1 month ago

The current implementation only supports simple TEXT generation. In order to support Structured output and other model features, we need to support additional parameters like the original prompt function, for instance:

model Model type, either 'gpt-4o-mini' (default), or 'gpt-4o-2024-08-06' (alias: 'gpt-4o')
temperature Model temperature value between 0 and 1, default: 0.1
struct Output schema as struct, e.g. {summary: 'VARCHAR', persons: 'VARCHAR[]'}. Will result in STRUCT output.
struct_descr Descriptions for struct fields that will be added to the model's context, e.g. {summary: 'a 1 sentence summary of the text', persons: 'an array of all persons mentioned in the text'}
json_schema A json schema that adheres to this guide. Provides more flexibility than the struct/struct_descr parameters. Will result in JSON output.
lmangani commented 1 month ago

Implemented json_schema and custom_prompt see README