hegelai / prompttools

Open-source tools for prompt testing and experimentation, with support for both LLMs (e.g. OpenAI, LLaMA) and vector databases (e.g. Chroma, Weaviate, LanceDB).
http://prompttools.readthedocs.io
Apache License 2.0
2.55k stars 216 forks source link

Example in README doesn't work #96

Closed stephantul closed 8 months ago

stephantul commented 9 months ago

🐛 Describe the bug

The example in the README doesn't work. I installed prompttools, upgraded openai to the latest version. The following snippet is what I ran.

from prompttools.experiment import OpenAIChatExperiment

prompts = ["Tell me a joke.", "Is 17077 a prime number?"]
models = ["gpt-3.5-turbo"]
temperatures = [0.0]
openai_experiment = OpenAIChatExperiment(models, prompts, temperature=temperatures)
openai_experiment.run()

This throws the following error when calling run.

openai.error.InvalidRequestError: 'Tell me a joke.' is not of type 'array' - 'messages'
NivekT commented 9 months ago

I will have a look at this. Thanks for opening this issue.