fixing ci issues

This commit is contained in:
Swifty
2026-01-05 21:02:49 +01:00
parent 9a83af2787
commit 7ee03fb0ec
7 changed files with 16 additions and 16 deletions

View File

@@ -6,11 +6,7 @@ from typing import Any
from prisma.models import ChatMessage as PrismaChatMessage
from prisma.models import ChatSession as PrismaChatSession
from prisma.types import (
ChatMessageCreateInput,
ChatSessionCreateInput,
ChatSessionUpdateInput,
)
from prisma.types import ChatSessionUpdateInput
from backend.util.json import SafeJson
@@ -34,7 +30,7 @@ async def create_chat_session(
user_id: str | None,
) -> PrismaChatSession:
"""Create a new chat session in the database."""
data: ChatSessionCreateInput = {
data = {
"id": session_id,
"userId": user_id,
"credentials": SafeJson({}),
@@ -94,7 +90,7 @@ async def add_chat_message(
function_call: dict[str, Any] | None = None,
) -> PrismaChatMessage:
"""Add a message to a chat session."""
data: ChatMessageCreateInput = {
data: dict[str, Any] = {
"Session": {"connect": {"id": session_id}},
"role": role,
"sequence": sequence,
@@ -133,7 +129,7 @@ async def add_chat_messages_batch(
created_messages = []
for i, msg in enumerate(messages):
data: ChatMessageCreateInput = {
data: dict[str, Any] = {
"Session": {"connect": {"id": session_id}},
"role": msg["role"],
"sequence": start_sequence + i,

View File

@@ -19,10 +19,12 @@ from .model import (
ChatMessage,
ChatSession,
Usage,
create_chat_session as model_create_chat_session,
get_chat_session,
upsert_chat_session,
)
from .model import (
create_chat_session as model_create_chat_session,
)
from .response_model import (
StreamBaseResponse,
StreamEnd,

View File

@@ -3,11 +3,11 @@
import logging
from typing import Any
from backend.api.features.chat.model import ChatSession
from backend.data.understanding import (
BusinessUnderstandingInput,
upsert_business_understanding,
)
from backend.api.features.chat.model import ChatSession
from .base import BaseTool
from .models import (

View File

@@ -6,8 +6,8 @@ import logging
import uuid
from typing import Any
from backend.data.graph import Graph, Link, Node, create_graph
from backend.api.features.library import db as library_db
from backend.data.graph import Graph, Link, Node, create_graph
from .client import AGENT_GENERATOR_MODEL, get_client
from .prompts import DECOMPOSITION_PROMPT, GENERATION_PROMPT, PATCH_PROMPT

View File

@@ -7,11 +7,11 @@ from typing import Any
from pydantic import BaseModel, field_validator
from backend.data import execution as execution_db
from backend.data.execution import ExecutionStatus, GraphExecution, GraphExecutionMeta
from backend.api.features.chat.model import ChatSession
from backend.api.features.library import db as library_db
from backend.api.features.library.model import LibraryAgent
from backend.data import execution as execution_db
from backend.data.execution import ExecutionStatus, GraphExecution, GraphExecutionMeta
from .base import BaseTool
from .models import (

View File

@@ -7,6 +7,7 @@ from pydantic import BaseModel, Field, field_validator
from backend.api.features.chat.config import ChatConfig
from backend.api.features.chat.model import ChatSession
from backend.api.features.library import db as library_db
from backend.data.graph import GraphModel
from backend.data.model import CredentialsMetaInput
from backend.data.user import get_user_by_id
@@ -38,8 +39,6 @@ from .utils import (
match_user_credentials_to_graph,
)
from backend.api.features.library import db as library_db
logger = logging.getLogger(__name__)
config = ChatConfig()

View File

@@ -12,7 +12,10 @@ from typing import Any, Literal
import prisma
from backend.api.features.store.embeddings import embed_query, embedding_to_vector_string
from backend.api.features.store.embeddings import (
embed_query,
embedding_to_vector_string,
)
logger = logging.getLogger(__name__)