Skip to content

feat: support structured embedding inputs - #776

Open
original4422 wants to merge 1 commit into
ollama:mainfrom
original4422:feat/structured-embedding-input
Open

original4422 wants to merge 1 commit into
ollama:mainfrom
original4422:feat/structured-embedding-input

Conversation

@original4422

Copy link
Copy Markdown

Summary

Allow the current server's structured /api/embed inputs through both sync and async clients, preserving text and mixed-batch item boundaries.

 embed(input)
-  text | sequence of text
+  text | {text, image, audio} string fields | mixed sequence

Media values are caller-supplied base64 strings. The README explains server/model capability requirements; this does not add media loading or make chat models support embeddings.

Related #414.

Evidence

  • Before: 12 sync/async image, audio and mixed-input regressions fail in EmbedRequest validation before HTTP.
    After: all 32 embed tests pass against the normal public clients and localhost HTTP fixture.
  • python -m pytest -q ollama tests: 154 passed.
  • hatch fmt --check -f and hatch fmt --check -l: passed.
  • Existing text/tuple/list/default inputs, options, dimensions, response parsing and server errors are covered. Responses are wire fixtures; no live daemon/model inference was run.

Merge Danger

Door: two-way.

Blast Radius: validation.

Expands only embed request input types. Media decoding and model compatibility remain server responsibilities; older servers may reject structured inputs.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T20:56:48.880795Z
We couldn’t complete this review. Comment @codex review to try again.
1185a72 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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