more stuff
Browse files
components/generators/daily_feed.py
CHANGED
@@ -7,6 +7,23 @@ from llama_index.core.schema import Document
|
|
7 |
from llama_index.core.query_engine import RetrieverQueryEngine
|
8 |
from components.LLMs.Mistral import call_mistral
|
9 |
from components.indexers.news_indexer import load_news_index,get_upstash_vector_store
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# 🔐 Environment variables
|
12 |
REDIS_URL = os.environ.get("UPSTASH_REDIS_URL", "redis://localhost:6379")
|
|
|
7 |
from llama_index.core.query_engine import RetrieverQueryEngine
|
8 |
from components.LLMs.Mistral import call_mistral
|
9 |
from components.indexers.news_indexer import load_news_index,get_upstash_vector_store
|
10 |
+
from llama_index.core.settings import Settings
|
11 |
+
from llama_index.llms.base import LLM, LLMMetadata
|
12 |
+
from llama_index.core.llms import CompletionResponse
|
13 |
+
|
14 |
+
class DummyLLM(LLM):
|
15 |
+
def complete(self, prompt: str, **kwargs) -> CompletionResponse:
|
16 |
+
return CompletionResponse(text="")
|
17 |
+
|
18 |
+
@property
|
19 |
+
def metadata(self) -> LLMMetadata:
|
20 |
+
return LLMMetadata(
|
21 |
+
context_window=8192,
|
22 |
+
num_output=1024,
|
23 |
+
is_chat_model=False
|
24 |
+
)
|
25 |
+
|
26 |
+
Settings.llm = DummyLLM()
|
27 |
|
28 |
# 🔐 Environment variables
|
29 |
REDIS_URL = os.environ.get("UPSTASH_REDIS_URL", "redis://localhost:6379")
|