Skip to content

Feat/embeddings#14

Merged
Verdenroz merged 6 commits intomasterfrom
feat/embeddings
Feb 21, 2026
Merged

Feat/embeddings#14
Verdenroz merged 6 commits intomasterfrom
feat/embeddings

Conversation

@Verdenroz
Copy link
Copy Markdown
Owner

Summary

  • Adds embedding support via a new EmbeddingAdapter protocol and Chimeric.embed() / Chimeric.aembed() methods
  • Implements embeddings for OpenAI, Google (Gemini), and Cohere — single string and batch (list[str]) inputs both supported
  • Introduces EmbeddingResponse and EmbeddingUsage types for a unified response shape across providers
  • Refactors Chimeric.__init__() to accept explicit timeout, max_retries, and default_headers parameters instead of **kwargs, improving discoverability and IDE support

Breaking Changes

  • Chimeric() no longer accepts arbitrary **kwargstimeout, max_retries, and default_headers must now be passed by name

Test Plan

  • Unit tests for OpenAIAdapter embedding request building and response parsing
  • Integration tests (cassette-recorded) for OpenAI, Google, and Cohere: single embed, batch embed, async variants, cosine similarity, and dimensions kwarg
  • test_doc_examples.py and test_chimeric.py updated to cover new Chimeric() constructor signature

Checklist

  • Tests pass (nox -s tests)
  • Coverage ≥ 80%
  • Docs updated (docs/usage/embeddings.md added, docs/usage/responses.md and docs/usage/configuration.md updated)
  • No hardcoded secrets or credentials

@Verdenroz Verdenroz merged commit 1840451 into master Feb 21, 2026
14 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 72.27723% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/chimeric/adapters/google.py 25.00% 12 Missing ⚠️
src/chimeric/adapters/cohere.py 25.00% 9 Missing ⚠️
src/chimeric/http.py 87.80% 3 Missing and 2 partials ⚠️
src/chimeric/adapters/base.py 50.00% 1 Missing ⚠️
src/chimeric/chimeric.py 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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