diff --git a/frontend/src/app/(withSidebar)/conversations/[id]/page.tsx b/frontend/src/app/(withSidebar)/conversations/[id]/page.tsx index c6b9009..49e017b 100644 --- a/frontend/src/app/(withSidebar)/conversations/[id]/page.tsx +++ b/frontend/src/app/(withSidebar)/conversations/[id]/page.tsx @@ -3,11 +3,10 @@ import { Button } from "@/components/ui/button"; import { api } from "@/domain/api/api"; import { useConfig } from "@/domain/config/ConfigProvider"; -import { useRouter } from "next/navigation"; +import { Send } from "lucide-react"; import { useState } from "react"; import { useMutation, useQuery, useQueryClient } from "react-query"; import MessageList from "../../../_components/MessageList"; -import { Send } from "lucide-react"; // Тип для хранения информации о чате type Conversation = { @@ -23,10 +22,8 @@ export default function ConversationPage({ params: { id: string }; }) { const [message, setMessage] = useState(""); - const [isSidebarOpen, setIsSidebarOpen] = useState(false); const config = useConfig(); - const router = useRouter(); const queryClient = useQueryClient(); const { data: currentConversation } = useQuery( diff --git a/frontend/src/app/(withSidebar)/conversations/layout.tsx b/frontend/src/app/(withSidebar)/conversations/layout.tsx index 8dde831..c55c992 100644 --- a/frontend/src/app/(withSidebar)/conversations/layout.tsx +++ b/frontend/src/app/(withSidebar)/conversations/layout.tsx @@ -20,7 +20,8 @@ export default function RootLayout({ const createConversationMutation = useMutation({ mutationFn: () => api.createConversation(config.ENDPOINT), onSuccess: (response: any) => { - router.push(`/conversations/${response.data.id}`); + console.log(response); + router.push(`/conversations/${response.conversation_id}`); }, }); diff --git a/infra/production/files/docker-compose.yaml b/infra/production/files/docker-compose.yaml index b3214a6..330da2c 100644 --- a/infra/production/files/docker-compose.yaml +++ b/infra/production/files/docker-compose.yaml @@ -66,11 +66,12 @@ services: - "traefik.http.routers.api.entrypoints=websecure" - "traefik.http.routers.api.tls.certresolver=myresolver" - "traefik.http.services.api.loadbalancer.server.port=5000" - - "traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=https://app.${HOST}" + - "traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=https://app.${HOST},http://localhost:3001" - "traefik.http.middlewares.cors.headers.accesscontrolallowmethods=GET,POST,PUT,DELETE,OPTIONS" - "traefik.http.middlewares.cors.headers.accesscontrolallowheaders=Content-Type,Authorization" - "traefik.http.middlewares.cors.headers.accesscontrolmaxage=100" - "traefik.http.middlewares.cors.headers.addvaryheader=true" + - "traefik.http.middlewares.cors.headers.accesscontrolallowcredentials=true" - "traefik.http.routers.api.middlewares=cors" db: @@ -104,6 +105,7 @@ services: - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} - CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0 - CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0 + - HOST=http://ml:8000/invoke depends_on: - db - redis @@ -116,6 +118,7 @@ services: environment: LLM_SOURCE: openai QDRANT_HOST: http://qdrant:6333 + QDRANT_COLLECTION_NAME: ${QDRANT_COLLECTION_NAME} QDRANT_API_KEY: ${QDRANT_API_KEY} OPENAI_API_KEY: ${OPENAI_API_KEY} diff --git a/infra/production/main.tf b/infra/production/main.tf index 5d22b0f..113b81b 100644 --- a/infra/production/main.tf +++ b/infra/production/main.tf @@ -35,6 +35,7 @@ module "app" { CELERY_RESULT_BACKEND = "redis://:password@redis:6379/0" OPENROUTER_API_KEY = "a" QDRANT_API_KEY = var.qdrant_api_key + QDRANT_COLLECTION_NAME = "new_docs" OPENAI_API_KEY = var.openai_api_key YC_API_KEY = yandex_iam_service_account_api_key.instance_service_account_api_key.secret_key FOLDER_ID = var.folder_id