Add user authentication dependency to create_response endpoint
This commit is contained in:
parent
683af24f9e
commit
76d1aee425
1 changed files with 4 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ import logging
|
|||
import uuid
|
||||
from typing import Dict, List, Optional, Any
|
||||
import openai
|
||||
from fastapi import APIRouter
|
||||
from fastapi import APIRouter, Depends
|
||||
from cognee.api.v1.responses.models import (
|
||||
ResponseRequest,
|
||||
ResponseResponse,
|
||||
|
|
@ -18,6 +18,8 @@ from cognee.api.v1.responses.models import (
|
|||
from cognee.api.v1.responses.dispatch_function import dispatch_function
|
||||
from cognee.api.v1.responses.default_tools import DEFAULT_TOOLS
|
||||
from cognee.infrastructure.llm.config import get_llm_config
|
||||
from cognee.modules.users.models import User
|
||||
from cognee.modules.users.methods import get_authenticated_user
|
||||
|
||||
|
||||
def get_responses_router() -> APIRouter:
|
||||
|
|
@ -69,6 +71,7 @@ def get_responses_router() -> APIRouter:
|
|||
@router.post("/", response_model=ResponseResponse)
|
||||
async def create_response(
|
||||
request: ResponseRequest,
|
||||
user: User = Depends(get_authenticated_user),
|
||||
) -> ResponseResponse:
|
||||
"""
|
||||
OpenAI-compatible responses endpoint with function calling support
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue