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

feat: Add siliconflow text embedding #39867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

junjiejiangjjj
Copy link
Contributor

@junjiejiangjjj junjiejiangjjj commented Feb 13, 2025

@sre-ci-robot sre-ci-robot added the size/XL Denotes a PR that changes 500-999 lines. label Feb 13, 2025
@sre-ci-robot sre-ci-robot requested review from czs007 and sunby February 13, 2025 11:29
@mergify mergify bot added the dco-passed DCO check passed. label Feb 13, 2025
Copy link
Contributor

mergify bot commented Feb 13, 2025

@junjiejiangjjj

Invalid PR Title Format Detected

Your PR submission does not adhere to our required standards. To ensure clarity and consistency, please meet the following criteria:

  1. Title Format: The PR title must begin with one of these prefixes:
  • feat: for introducing a new feature.
  • fix: for bug fixes.
  • enhance: for improvements to existing functionality.
  • test: for add tests to existing functionality.
  • doc: for modifying documentation.
  • auto: for the pull request from bot.
  1. Description Requirement: The PR must include a non-empty description, detailing the changes and their impact.

Required Title Structure:

[Type]: [Description of the PR]

Where Type is one of feat, fix, enhance, test or doc.

Example:

enhance: improve search performance significantly 

Please review and update your PR to comply with these guidelines.

@junjiejiangjjj junjiejiangjjj changed the title Add siliconflow text embedding feat: Add siliconflow text embedding Feb 13, 2025
@mergify mergify bot added kind/feature Issues related to feature request from users and removed do-not-merge/invalid-pr-format labels Feb 13, 2025
Copy link
Contributor

mergify bot commented Feb 13, 2025

@junjiejiangjjj go-sdk check failed, comment rerun go-sdk can trigger the job again.

@junjiejiangjjj
Copy link
Contributor Author

rerun go-sdk

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 85.12397% with 18 lines in your changes missing coverage. Please review.

Project coverage is 79.76%. Comparing base (0345753) to head (42ced4a).
Report is 46 commits behind head on master.

Files with missing lines Patch % Lines
...n/models/siliconflow/siliconflow_text_embedding.go 81.63% 6 Missing and 3 partials ⚠️
...al/util/function/siliconflow_embedding_provider.go 87.14% 6 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #39867       +/-   ##
===========================================
+ Coverage   69.39%   79.76%   +10.37%     
===========================================
  Files         302     1502     +1200     
  Lines       27077   207583   +180506     
===========================================
+ Hits        18790   165579   +146789     
- Misses       8287    35974    +27687     
- Partials        0     6030     +6030     
Components Coverage Δ
Client 79.25% <ø> (∅)
Core 69.63% <ø> (+0.23%) ⬆️
Go 81.41% <85.12%> (∅)
Files with missing lines Coverage Δ
internal/util/function/common.go 100.00% <ø> (ø)
internal/util/function/text_embedding_function.go 93.18% <100.00%> (ø)
...n/models/siliconflow/siliconflow_text_embedding.go 81.63% <81.63%> (ø)
...al/util/function/siliconflow_embedding_provider.go 87.14% <87.14%> (ø)

... and 1243 files with indirect coverage changes

@mergify mergify bot added the ci-passed label Feb 13, 2025
@junjiejiangjjj
Copy link
Contributor Author

/assign @zhengbuqian @liliu-z

}

func NewSiliconflowEmbeddingProvider(fieldSchema *schemapb.FieldSchema, functionSchema *schemapb.FunctionSchema) (*SiliconflowEmbeddingProvider, error) {
fieldDim, err := typeutil.GetDim(fieldSchema)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking form the api doc they do not support provide dim in the request, what is the dim of those embedding models of silliconflow?

if each of their models have a constant dim, should we enforce this earlier? in the current impl if the user sets a incorrect dim, the error is deferred until after some data was embeded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, there is no check at the creation stage to see if field dim and model dim are consistent, only at the runtime stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later we can consider adding relevant checks in the creation phase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: junjiejiangjjj
To complete the pull request process, please ask for approval from liliu-z after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify bot removed the ci-passed label Feb 19, 2025
Copy link
Contributor

mergify bot commented Feb 19, 2025

@junjiejiangjjj cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

@junjiejiangjjj
Copy link
Contributor Author

rerun cpp-unit-test

@zhengbuqian
Copy link
Collaborator

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-passed dco-passed DCO check passed. kind/feature Issues related to feature request from users lgtm size/XL Denotes a PR that changes 500-999 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants