Skip to content

Support for ChatCompletions #70

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

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Support for ChatCompletions #70

merged 1 commit into from
Mar 3, 2023

Conversation

zurawiki
Copy link
Owner

@zurawiki zurawiki commented Mar 3, 2023

  • Added new function should_use_chat_completion to determine if chat completion should be used
  • Added new functions get_chat_completions and get_completions to handle chat and regular completions respectively
  • Default Model is gpt-3.5-turbo
    Closes support chatGPT model #65

- Added new functions and modified the `completions` function to handle chat and regular completions in `src/llms/openai.rs`
- Moved `CreateChatCompletionRequestArgs` and `Role` to a new namespace in `async_openai::types`
- Increased visibility of `get_prompt_token_limit_for_model` for future use in `src/llms/openai.rs`

[src/llms/openai.rs]
- Added new function `should_use_chat_completion` to determine if chat completion should be used
- Added new functions `get_chat_completions` and `get_completions` to handle chat and regular completions respectively
- Modified `completions` function to call `get_chat_completions` or `get_completions` based on `should_use_chat_completion`
- Moved `CreateChatCompletionRequestArgs` and `Role` into `async_openai::types` namespace
- Increased visibility of `get_prompt_token_limit_for_model` for future use
@zurawiki zurawiki merged commit 865f8d3 into main Mar 3, 2023
@zurawiki zurawiki deleted the chat-gpt branch March 3, 2023 05:00
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

Successfully merging this pull request may close these issues.

support chatGPT model
1 participant