Update app.py
Browse files
app.py
CHANGED
|
@@ -29,6 +29,7 @@ class BasicAgent:
|
|
| 29 |
|
| 30 |
chat = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
| 31 |
|
|
|
|
| 32 |
# llm = HuggingFaceEndpoint(
|
| 33 |
# repo_id="mistralai/Mistral-7B-Instruct-v0.2",
|
| 34 |
# huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"),
|
|
@@ -43,6 +44,7 @@ class BasicAgent:
|
|
| 43 |
# Bind LLM with tools
|
| 44 |
chat_with_tools = chat.bind_tools(tools)
|
| 45 |
|
|
|
|
| 46 |
# Assistant function (process one step)
|
| 47 |
def assistant(state: AgentState):
|
| 48 |
return {
|
|
@@ -51,11 +53,11 @@ class BasicAgent:
|
|
| 51 |
|
| 52 |
# Create a StateGraph
|
| 53 |
builder = StateGraph(AgentState)
|
| 54 |
-
|
| 55 |
# Add nodes
|
| 56 |
builder.add_node("assistant", assistant)
|
| 57 |
builder.add_node("tools", ToolNode(tools))
|
| 58 |
-
|
| 59 |
# Define edges
|
| 60 |
builder.add_edge(START, "assistant")
|
| 61 |
builder.add_conditional_edges("assistant", tools_condition)
|
|
|
|
| 29 |
|
| 30 |
chat = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
| 31 |
|
| 32 |
+
print("check1")
|
| 33 |
# llm = HuggingFaceEndpoint(
|
| 34 |
# repo_id="mistralai/Mistral-7B-Instruct-v0.2",
|
| 35 |
# huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"),
|
|
|
|
| 44 |
# Bind LLM with tools
|
| 45 |
chat_with_tools = chat.bind_tools(tools)
|
| 46 |
|
| 47 |
+
print("check2")
|
| 48 |
# Assistant function (process one step)
|
| 49 |
def assistant(state: AgentState):
|
| 50 |
return {
|
|
|
|
| 53 |
|
| 54 |
# Create a StateGraph
|
| 55 |
builder = StateGraph(AgentState)
|
| 56 |
+
print("check3")
|
| 57 |
# Add nodes
|
| 58 |
builder.add_node("assistant", assistant)
|
| 59 |
builder.add_node("tools", ToolNode(tools))
|
| 60 |
+
print("check4")
|
| 61 |
# Define edges
|
| 62 |
builder.add_edge(START, "assistant")
|
| 63 |
builder.add_conditional_edges("assistant", tools_condition)
|