Skip to content

Commit

Permalink
final fix for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase committed Sep 12, 2024
1 parent 39fbc38 commit d938b97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 1 addition & 4 deletions frontend/src/app/(withSidebar)/conversations/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/(withSidebar)/conversations/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
},
});

Expand Down
5 changes: 4 additions & 1 deletion infra/production/files/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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}

Expand Down
1 change: 1 addition & 0 deletions infra/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d938b97

Please sign in to comment.