Update provider_validation.py
This commit is contained in:
parent
a6f1ed7c48
commit
d60432b1e0
1 changed files with 3 additions and 5 deletions
|
|
@ -365,18 +365,16 @@ async def _test_watsonx_embedding(
|
||||||
|
|
||||||
# Ollama validation functions
|
# Ollama validation functions
|
||||||
async def _test_ollama_lightweight_health(endpoint: str) -> None:
|
async def _test_ollama_lightweight_health(endpoint: str) -> None:
|
||||||
"""Test Ollama availability with lightweight /api/tags endpoint.
|
"""Test Ollama availability with lightweight status check.
|
||||||
|
|
||||||
This endpoint is very fast and doesn't block on active requests,
|
Only checks if the endpoint returns a 200 status without fetching data.
|
||||||
making it ideal for health checks when Ollama might be busy.
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
ollama_url = transform_localhost_url(endpoint)
|
ollama_url = transform_localhost_url(endpoint)
|
||||||
url = f"{ollama_url}/api/tags"
|
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
response = await client.get(
|
response = await client.get(
|
||||||
url,
|
ollama_url,
|
||||||
timeout=10.0, # Short timeout for lightweight check
|
timeout=10.0, # Short timeout for lightweight check
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue