-
-
Notifications
You must be signed in to change notification settings - Fork 248
GigaChat LLM support #917
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
base: main
Are you sure you want to change the base?
GigaChat LLM support #917
Conversation
# Conflicts: # Gemfile.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.
Files not reviewed (3)
- spec/fixtures/llm/gigachat/chat.json: Language not supported
- spec/fixtures/llm/gigachat/chat_chunk.json: Language not supported
- spec/fixtures/llm/gigachat/chat_with_function_call.json: Language not supported
) | ||
raise ArgumentError.new("text argument is required") if text.empty? | ||
raise ArgumentError.new("model argument is required") if model.empty? | ||
raise ArgumentError.new("encoding_format must be either float or base64") if encoding_format && %w[float base64].include?(encoding_format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition for raising an ArgumentError for encoding_format appears reversed; it should instead raise an error if encoding_format is provided and is not one of 'float' or 'base64'. For example, consider changing the condition to: if encoding_format && !%w[float base64].include?(encoding_format)
raise ArgumentError.new("encoding_format must be either float or base64") if encoding_format && %w[float base64].include?(encoding_format) | |
raise ArgumentError.new("encoding_format must be either float or base64") if encoding_format && !%w[float base64].include?(encoding_format) |
Copilot uses AI. Check for mistakes.
end | ||
|
||
def default_dimensions | ||
@defaults[:dimensions] || EMBEDDING_SIZES.fetch(defaults[:embedding_model]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_dimensions uses EMBEDDING_SIZES.fetch(defaults[:embedding_model]), but EMBEDDING_SIZES is an empty hash which may lead to a KeyError at runtime. Consider revising the logic or providing a proper default embedding size.
@defaults[:dimensions] || EMBEDDING_SIZES.fetch(defaults[:embedding_model]) | |
@defaults[:dimensions] || EMBEDDING_SIZES.fetch(@defaults[:embedding_model], nil) |
Copilot uses AI. Check for mistakes.
Implemented GigaChat LLM support. Please take a look.