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

how to pass messages list to model.prompt() #506

Open
cometta opened this issue Jun 6, 2024 · 0 comments
Open

how to pass messages list to model.prompt() #506

cometta opened this issue Jun 6, 2024 · 0 comments

Comments

@cometta
Copy link

cometta commented Jun 6, 2024

this is the example i found in the tutorial, if i have list of messages how to call prompt() ?

response = model.prompt("<can i put list of json messages here>")

below is example when i use openai library

messages = [
    {"role": "system", "content": "message 1"},
    {"role": "user", "content": "message 2"}
    {"role": "assistant", "content": "message 3"}
    {"role": "user", "content": "message 4"}
    
]

response = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=messages
)

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