simonw / datasette-openai

SQL functions for calling OpenAI APIs
https://datasette.io/plugins/datasette-openai
Apache License 2.0
21 stars 3 forks source link

openai_build_prompt() generating too long a prompt #8

Open simonw opened 1 year ago

simonw commented 1 year ago

Something seems to have gone wrong here: https://datasette.simonwillison.net/simonwillisonblog/answer_question?question=Use+cases+for+newsrooms+using+Datasette+Cloud&_hide_sql=1

C3E1AF50-C4A8-4071-9087-EE6026DD9742

Is my token counting not right? Is there a logic problem with how it decides how much of an extract of each one to sue?

Ideally need to replicate this in a test.