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

[model] add support for chatcompletion models #31

Closed
signebedi opened this issue Mar 28, 2023 · 1 comment
Closed

[model] add support for chatcompletion models #31

signebedi opened this issue Mar 28, 2023 · 1 comment

Comments

@signebedi
Copy link
Owner

signebedi commented Mar 28, 2023

add support for chatcompletion models
Currently, we only support completion models. Subsequently, we will need to find a way to support chat completion too.

References

  1. chat completion source code python https://github.com/openai/openai-python/blob/main/openai/api_resources/chat_completion.py#L8
  2. chat completion create https://platform.openai.com/docs/api-reference/chat/create
  3. chat completions general introduction https://platform.openai.com/docs/guides/chat
  4. list of models https://platform.openai.com/docs/models/overview

Originally posted by @signebedi in #30 (comment)

@signebedi
Copy link
Owner Author

[model] extend keyword tokenization to ChatCompletion models
Currently, keyword tokenization (and context structuring generally) is limited to Completion models. We should update the context logic to correctly structure ChatCompletion messages:

  messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who won the world series in 2020?"},
        {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        {"role": "user", "content": "Where was it played?"}
    ]

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