Skip to content

fix(jina): remove encoding_format for jina embedding - #1943

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
RedwindA:fix/jina-embedding
Oct 1, 2025
Merged

fix(jina): remove encoding_format for jina embedding#1943
seefs001 merged 1 commit into
QuantumNous:mainfrom
RedwindA:fix/jina-embedding

Conversation

@RedwindA

@RedwindA RedwindA commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

close #1941

Summary by CodeRabbit

  • Bug Fixes
    • Improved embedding request handling by explicitly clearing the encoding format to prevent unintended or inconsistent encoding. This enhances compatibility with certain providers and reduces edge-case errors in downstream processing. Most users should see no behavioral change, but this resolves issues where embeddings could be returned with mismatched or malformed encodings, resulting in more reliable and predictable embedding responses.

@coderabbitai

coderabbitai Bot commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Sets EncodingFormat to an empty string in ConvertEmbeddingRequest for Jina embedding requests; no other logic or control flow changes.

Changes

Cohort / File(s) Summary
Jina embedding adaptor
relay/channel/jina/adaptor.go
In ConvertEmbeddingRequest, explicitly clears request.EncodingFormat (sets to empty string) to avoid sending unsupported parameter to Jina. No other changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Adaptor as Jina Adaptor
  participant JinaAPI as Jina Embeddings API

  Client->>Adaptor: ConvertEmbeddingRequest(req)
  Note over Adaptor: Clear unsupported field<br/>req.EncodingFormat = ""
  Adaptor->>JinaAPI: POST /embeddings (without encoding_format)
  JinaAPI-->>Adaptor: Embedding response
  Adaptor-->>Client: Return response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nibbled a flag that didn’t belong,
A stray little byte in the Jina song.
Snip! went the whiskers, clean and bright—
No encoding_format in sight.
Now embeddings hop swift and true,
Bunny-approved, squeaky new! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “fix(jina): remove encoding_format for jina embedding” succinctly and accurately describes the core change of stripping out the encoding_format parameter for Jina embedding requests. It is clear, concise, and directly reflects the main update implemented in the PR, enabling team members to immediately understand its purpose.
Linked Issues Check ✅ Passed The pull request implements the removal of the unsupported encoding_format parameter by setting request.EncodingFormat to an empty string in the ConvertEmbeddingRequest function, directly addressing the error detailed in issue #1941 where Jina rejects extra inputs. This change ensures that embedding requests no longer carry the unsupported field and can execute successfully on Jina without further errors. No additional code modifications are present, so the PR fully aligns with the objectives of the linked issue.
Out of Scope Changes Check ✅ Passed The only alteration in this PR is clearing the encoding_format parameter in the Jina adaptor, and no other files or logic have been modified. This change is precisely aligned with the issue’s scope of removing unsupported parameters for Jina embeddings. There are no unrelated or extraneous updates introduced.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b91e45 and f5a774f.

📒 Files selected for processing (1)
  • relay/channel/jina/adaptor.go (1 hunks)
🔇 Additional comments (1)
relay/channel/jina/adaptor.go (1)

79-80: Clearing encoding_format unblocks Jina requests

Good catch—resetting EncodingFormat to "" ensures the JSON encoder omits the field, so Jina no longer complains about unexpected parameters. 👍


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seefs001
seefs001 merged commit 15db5c0 into QuantumNous:main Oct 1, 2025
1 check passed
x22x22 pushed a commit to x22x22/new-api that referenced this pull request Apr 24, 2026
fix(jina): remove encoding_format for jina embedding
jiutubaba pushed a commit to jiutubaba/fx-api that referenced this pull request May 17, 2026
…preoutput-failover

fix(openai): 修复 Responses 流式失败前置事件导致无法 failover
@RedwindA
RedwindA deleted the fix/jina-embedding branch July 23, 2026 07:04
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.

Jina不支持encoding_format参数

2 participants