pycache 추가

This commit is contained in:
kyy
2025-10-30 10:31:18 +09:00
parent 2bb5879169
commit bea690d3f1
88 changed files with 0 additions and 2104 deletions

View File

@@ -1,27 +0,0 @@
import httpx
OLLAMA_API_URL = "http://172.16.10.176:11534/api/generate"
class OllamaService:
async def generate_content(self, prompt: str, model: str = "gemma:latest"):
"""Ollama API를 호출하여 콘텐츠를 생성합니다."""
async with httpx.AsyncClient(timeout=120.0) as client:
try:
payload = {
"model": model,
"prompt": prompt,
"stream": False,
"keep_alive": "30m",
}
response = await client.post(OLLAMA_API_URL, json=payload)
response.raise_for_status()
response_json = response.json()
return response_json.get("response", "")
except httpx.RequestError as e:
print(f"Ollama API 요청 중 오류 발생: {e}")
return f"Error: {e}"
except Exception as e:
print(f"Ollama 서비스에서 예기치 않은 오류 발생: {e}")
return f"An unexpected error occurred: {e}"