- Add /v1/chat/completions endpoint (POST) with streaming support - Add /v1/models endpoint (GET) listing available models - Add /v1/completions endpoint (POST) legacy compatibility - Add llm_api.py module with OpenAI API proxy via aiohttp - Add llm_service_url, llm_api_key, available_models to config model - Update harnessed_agent_config_view CRUD to protect API key field - Register new functions in init.py (harnessed_llm_chat_completions etc.) - Add .gitignore for pycache files Endpoints available under module path: POST /harnessed_agent/v1/chat/completions GET /harnessed_agent/v1/models POST /harnessed_agent/v1/completions
10 lines
203 B
Plaintext
10 lines
203 B
Plaintext
"""
|
|
OpenAI-compatible /v1/models endpoint
|
|
Returns list of available models.
|
|
"""
|
|
import json
|
|
|
|
async def main():
|
|
result = await harnessed_llm_models()
|
|
return json.dumps(result, ensure_ascii=False)
|