removing changes
Browse files
components/generators/daily_feed.py
CHANGED
@@ -4,27 +4,9 @@ import redis
|
|
4 |
from typing import List, Dict
|
5 |
from llama_index.core import VectorStoreIndex, StorageContext
|
6 |
from llama_index.core.query_engine import RetrieverQueryEngine
|
7 |
-
from llama_index.llms.base import LLM, LLMMetadata
|
8 |
-
from llama_index.core.llms import CompletionResponse
|
9 |
-
from llama_index.core.settings import Settings
|
10 |
from components.LLMs.Mistral import call_mistral
|
11 |
from components.indexers.news_indexer import get_upstash_vector_store
|
12 |
|
13 |
-
# β
Dummy LLM config to allow higher context window in LlamaIndex
|
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")
|
30 |
REDIS_KEY = os.environ.get("UPSTASH_REDIS_TOKEN")
|
|
|
4 |
from typing import List, Dict
|
5 |
from llama_index.core import VectorStoreIndex, StorageContext
|
6 |
from llama_index.core.query_engine import RetrieverQueryEngine
|
|
|
|
|
|
|
7 |
from components.LLMs.Mistral import call_mistral
|
8 |
from components.indexers.news_indexer import get_upstash_vector_store
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# π Environment variables
|
11 |
REDIS_URL = os.environ.get("UPSTASH_REDIS_URL", "redis://localhost:6379")
|
12 |
REDIS_KEY = os.environ.get("UPSTASH_REDIS_TOKEN")
|