Python: [Bug]: OllamaEmbeddingClient drops numeric zero keep_alive
I maintainer di solito rispondono entro 1 giorno
@eavanvalkenburg ci sta già lavorando.
Dal 1/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
OllamaEmbeddingClient.get_embeddings silently drops numeric keep_alive=0 and 0.0 from the request. Ollama accepts numeric zero as an explicit keep-alive duration; the framework's declared option type also accepts it.
The embedding adapter uses if keep_alive := opts.get("keep_alive"), so zero is treated as absent. The real Ollama SDK serializes zero correctly when called directly. String "0", negative durations and positive durations are forwarded by the framework.
Expected: explicitly supplied numeric zero reaches /api/embed, while an omitted setting remains omitted.
Observed: the framework sends only model and input for numeric zero.
Reproduction
import asyncio
import json
import httpx
from ollama import AsyncClient
from agent_framework_ollama import OllamaEmbeddingClient
async def main():
def respond(request):
print(json.loads(request.content))
return httpx.Response(200, json={"model": "test-model", "embeddings": [[0.1, 0.2]]})
sdk = AsyncClient(host="http://ollama.test", transport=httpx.MockTransport(respond))
async with sdk._client:
client = OllamaEmbeddingClient(model="test-model", client=sdk)
await client.get_embeddings(["hello"], options={"keep_alive": 0})
await sdk.embed(model="test-model", input=["hello"], keep_alive=0)
asyncio.run(main())
Output before the fix:
{'model': 'test-model', 'input': ['hello']}
{'model': 'test-model', 'input': ['hello'], 'keep_alive': 0.0}
Environment
Current main 7634356a1de0fd5de287544113c34d32afeeba83, Python 3.11.15, Ollama SDK 0.5.3. Reproduction uses the real SDK with a simulated HTTP transport and needs no model/server.
Proposed contribution
I have prepared a focused change to use an explicit is not None guard and add HTTP-boundary regression coverage for zero and existing duration/omission behavior. I would like to contribute this fix. It adds no API or dependency.
- Lingua principale
- Python
- Stelle
- 14k
- Fork
- 2.5k
- Merge medio
- 2g 2h
- PR unite (30g)
- 389
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/agent-framework
-
Python: [Bug]: Out-of-range Cosmos memory search parameters silently disable retrievalForse già presa @Lesereingrape l’ha presa oggi. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/agent-framework#9317 ·
I maintainer di solito rispondono entro 1 giorno
-
Python: [Bug]: A non-positive MCP request timeout silently disables the timeoutForse già presa @Lesereingrape l’ha presa 1 giorno fa. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/agent-framework#9313 ·
I maintainer di solito rispondono entro 1 giorno
-
Python: [Bug]: Content.from_dict leaves the nested content of image generation and MCP server tool results as plain dictsForse già presa @shanto462 l’ha presa 1 giorno fa. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
microsoft/agent-framework#9303 ·
I maintainer di solito rispondono entro 1 giorno
-
.NET: Python: [Bug]: Two switch-case branches cannot route to the same executor (EdgeDuplicationError)Forse già presa @shanto462 l’ha presa 1 giorno fa. Aperta.NET python triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/agent-framework#9297 ·
I maintainer di solito rispondono entro 1 giorno
-
.NET python triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
microsoft/agent-framework#9092 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/agent-framework
Issue simili
-
effort: low prio: low ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
digitalfabrik/integreat-cms#4616 ·
I maintainer di solito rispondono entro 5 giorni
-
bug difficulty:2 good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
MakazhanAlpamys/Soup#1865 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FinanceFlash/unvibecode#233 ·
I maintainer di solito rispondono entro 1 giorno
-
area: agents area: docs good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exemptForse già presa @adityasinha-ghub l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
pylint-dev/pylint#11656 ·
I maintainer di solito rispondono entro 1 giorno