Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

GigaChat LLM support #917

wants to merge 3 commits into from

Conversation

skk2010
Copy link

@skk2010 skk2010 commented Feb 8, 2025

Implemented GigaChat LLM support. Please take a look.

@andreibondarev andreibondarev requested a review from Copilot April 17, 2025 18:20
Copy link

@Copilot Copilot AI left a 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)
Copy link
Preview

Copilot AI Apr 17, 2025

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)

Suggested change
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])
Copy link
Preview

Copilot AI Apr 17, 2025

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.

Suggested change
@defaults[:dimensions] || EMBEDDING_SIZES.fetch(defaults[:embedding_model])
@defaults[:dimensions] || EMBEDDING_SIZES.fetch(@defaults[:embedding_model], nil)

Copilot uses AI. Check for mistakes.

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.

1 participant