Refactor API structure: move chat functionality to v1 router, implement dependency injection for OpenAI client, and set up application state management
Build and Push Agent API / build (push) Successful in 6s
Build and Push Agent API / build (push) Successful in 6s
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from dotenv import load_dotenv
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
load_dotenv(Path(__file__).resolve().parent.parent / ".env")
|
||||
|
||||
DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
|
||||
@@ -0,0 +1,9 @@
|
||||
from openai import OpenAI
|
||||
|
||||
|
||||
def create_client(api_key: str) -> OpenAI:
|
||||
"""Factory for an OpenAI-compatible client pointed at DeepSeek."""
|
||||
return OpenAI(
|
||||
api_key=api_key,
|
||||
base_url="https://api.deepseek.com",
|
||||
)
|
||||
Reference in New Issue
Block a user