Spaces:
Sleeping
Sleeping
deprecation
Browse files
agent.py
CHANGED
@@ -74,7 +74,7 @@ class BoomBot:
|
|
74 |
return OpenAIServerModel(
|
75 |
model_id=deepinfra_model,
|
76 |
api_base="https://api.deepinfra.com/v1/openai",
|
77 |
-
api_key=os.environ["DEEPINFRA_API_KEY"],
|
78 |
flatten_messages_as_text=True,
|
79 |
max_tokens=8192,
|
80 |
temperature=0.1,
|
@@ -84,7 +84,7 @@ class BoomBot:
|
|
84 |
return OpenAIServerModel(
|
85 |
model_id=meta_model,
|
86 |
api_base="https://api.deepinfra.com/v1/openai",
|
87 |
-
api_key=os.environ["DEEPINFRA_API_KEY"],
|
88 |
flatten_messages_as_text=True,
|
89 |
max_tokens=8192,
|
90 |
temperature=0.7,
|
|
|
74 |
return OpenAIServerModel(
|
75 |
model_id=deepinfra_model,
|
76 |
api_base="https://api.deepinfra.com/v1/openai",
|
77 |
+
# api_key=os.environ["DEEPINFRA_API_KEY"],
|
78 |
flatten_messages_as_text=True,
|
79 |
max_tokens=8192,
|
80 |
temperature=0.1,
|
|
|
84 |
return OpenAIServerModel(
|
85 |
model_id=meta_model,
|
86 |
api_base="https://api.deepinfra.com/v1/openai",
|
87 |
+
# api_key=os.environ["DEEPINFRA_API_KEY"],
|
88 |
flatten_messages_as_text=True,
|
89 |
max_tokens=8192,
|
90 |
temperature=0.7,
|
tools.py
CHANGED
@@ -22,7 +22,7 @@ from duckduckgo_search.exceptions import (
|
|
22 |
RatelimitException,
|
23 |
TimeoutException,
|
24 |
)
|
25 |
-
from
|
26 |
BSHTMLLoader,
|
27 |
JSONLoader,
|
28 |
PyPDFLoader,
|
@@ -288,7 +288,8 @@ class BraveWebSearchTool(Tool):
|
|
288 |
}
|
289 |
output_type = "string"
|
290 |
|
291 |
-
api_key = os.getenv("BRAVE_SEARCH_API_KEY")
|
|
|
292 |
count = 3
|
293 |
char_limit = 4000 # Adjust based on LLM context window
|
294 |
tool = BraveSearch.from_api_key(api_key=api_key, search_kwargs={"count": count})
|
@@ -545,7 +546,7 @@ class DuckDuckGoSearchTool(Tool):
|
|
545 |
return f"❌ Failed to retrieve results after {max_retries} retries."
|
546 |
|
547 |
huggingface_ef = embedding_functions.HuggingFaceEmbeddingFunction(
|
548 |
-
|
549 |
)
|
550 |
SUPPORTED_EXTENSIONS = [
|
551 |
".txt",
|
|
|
22 |
RatelimitException,
|
23 |
TimeoutException,
|
24 |
)
|
25 |
+
from langchain_community.document_loaders import (
|
26 |
BSHTMLLoader,
|
27 |
JSONLoader,
|
28 |
PyPDFLoader,
|
|
|
288 |
}
|
289 |
output_type = "string"
|
290 |
|
291 |
+
# api_key = os.getenv("BRAVE_SEARCH_API_KEY")
|
292 |
+
api_key=None
|
293 |
count = 3
|
294 |
char_limit = 4000 # Adjust based on LLM context window
|
295 |
tool = BraveSearch.from_api_key(api_key=api_key, search_kwargs={"count": count})
|
|
|
546 |
return f"❌ Failed to retrieve results after {max_retries} retries."
|
547 |
|
548 |
huggingface_ef = embedding_functions.HuggingFaceEmbeddingFunction(
|
549 |
+
model_name="sentence-transformers/all-mpnet-base-v2"
|
550 |
)
|
551 |
SUPPORTED_EXTENSIONS = [
|
552 |
".txt",
|