Update tools.py
Browse files
tools.py
CHANGED
@@ -135,24 +135,18 @@ def build_graph(csv_file_path: str = "embeddings.csv"):
|
|
135 |
|
136 |
|
137 |
import os
|
138 |
-
|
139 |
-
from langchain_community.chat_models import ChatHuggingFace
|
140 |
-
from huggingface_hub import InferenceClient
|
141 |
-
|
142 |
-
from langchain_community.chat_models import ChatHuggingFace
|
143 |
|
144 |
-
|
|
|
|
|
145 |
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
146 |
-
huggingfacehub_api_token=os.environ["agents_token"]
|
|
|
|
|
147 |
)
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
# Bind tools to LLM
|
154 |
llm_with_tools = llm.bind_tools(tools=tools)
|
155 |
|
|
|
156 |
|
157 |
# Function to enrich state with relevant content from vector store
|
158 |
def retrieve_docs(state: MessagesState) -> MessagesState:
|
|
|
135 |
|
136 |
|
137 |
import os
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
+
from langchain_huggingface import HuggingFaceEndpoint
|
140 |
+
|
141 |
+
llm = HuggingFaceEndpoint(
|
142 |
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
143 |
+
huggingfacehub_api_token=os.environ["agents_token"],
|
144 |
+
task="text-generation",
|
145 |
+
model_kwargs={"max_new_tokens": 512, "temperature": 0.7}
|
146 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
llm_with_tools = llm.bind_tools(tools=tools)
|
148 |
|
149 |
+
|
150 |
|
151 |
# Function to enrich state with relevant content from vector store
|
152 |
def retrieve_docs(state: MessagesState) -> MessagesState:
|