Skip to content

Commit

Permalink
Merge pull request #19 from dsba6010-llm-applications/fixing-fun-times
Browse files Browse the repository at this point in the history
Refactor code and delete unused files
  • Loading branch information
ericphann authored Nov 24, 2024
2 parents ebd1576 + a0d59dc commit 4dc0274
Show file tree
Hide file tree
Showing 35 changed files with 32 additions and 779 deletions.
Binary file removed .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Visual Studio Code settings
.vscode/

.DS_STORE

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
Binary file removed backend/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
12 changes: 6 additions & 6 deletions backend/src/agent/graph.py → backend/agent/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import json
import os
from langchain_openai import ChatOpenAI
from backend.src.agent.state import State
from backend.src.agent.nodes.assistant import Assistant
from backend.src.agent.utils import create_tool_node_with_fallback
from backend.src.agent.tools.general import book_a_cab, book_a_table, answer_question
from backend.src.agent.rag import populate_vector_db, create_faiss_store
from backend.agent.state import State
from backend.agent.nodes.assistant import Assistant
from backend.agent.utils import create_tool_node_with_fallback
from backend.agent.tools.general import book_a_cab, book_a_table, answer_question
from backend.agent.rag import populate_vector_db, create_faiss_store


token = os.environ.get("OPENAI_API_KEY")
Expand Down Expand Up @@ -61,7 +61,7 @@

builder = StateGraph(State)
routes: list = json.load(
open(os.path.dirname(os.path.abspath(__file__)) + "/../../../role-values.json")
open(os.path.dirname(os.path.abspath(__file__)) + "/../../role-values.json")
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from langchain_core.runnables import Runnable, RunnableConfig
from backend.src.agent.state import State
from backend.agent.state import State


class Assistant:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/src/agent/state.py → backend/agent/state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TypedDict, Annotated, Dict, Any, List

# from langgraph.graph import add_messages
from backend.src.agent.utils import add_messages_to_dict
from backend.agent.utils import add_messages_to_dict
from langchain_core.messages import AnyMessage


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from langchain.schema import StrOutputParser
from langchain.schema.runnable import RunnablePassthrough
from langchain_core.prompts import ChatPromptTemplate
from backend.src.agent.rag import load_faiss_store
from backend.agent.rag import load_faiss_store

# from openai import OpenAI
from langchain_openai import OpenAI, OpenAIEmbeddings
Expand Down
2 changes: 1 addition & 1 deletion backend/src/agent/utils.py → backend/agent/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from langchain_core.messages import ToolMessage
from langchain_core.runnables import RunnableLambda
from backend.src.agent.nodes.tool_node import ToolNode
from backend.agent.nodes.tool_node import ToolNode
from langgraph.graph import add_messages
from typing import Union

Expand Down
File renamed without changes.
Binary file removed backend/src/.DS_Store
Binary file not shown.
205 changes: 0 additions & 205 deletions backend/src/api.py

This file was deleted.

82 changes: 0 additions & 82 deletions backend/src/client.py

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions dinebot_app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import streamlit as st
from backend.src.agent.graph import graph
from backend.src.agent.utils import _print_event
from backend.agent.graph import graph
from backend.agent.utils import _print_event
from langchain_core.messages import ToolMessage, HumanMessage, AIMessage
from langchain.callbacks.base import BaseCallbackHandler
from langchain_core.output_parsers import StrOutputParser
Expand Down
Binary file removed frontend/.DS_Store
Binary file not shown.
Loading

0 comments on commit 4dc0274

Please sign in to comment.