Upload folder using huggingface_hub
Browse files- src/clients.py +3 -3
- src/config.py +17 -11
src/clients.py
CHANGED
|
@@ -260,9 +260,9 @@ if __name__ == "__main__":
|
|
| 260 |
# logger.error(f"api of weaviate is not working")
|
| 261 |
# client.close()
|
| 262 |
|
| 263 |
-
gen_prompt = Prompt_template_LLM_Generation.format(
|
| 264 |
-
|
| 265 |
-
logger.info(f"groq qwen generate.....: {groq_qwen_generate_content(gen_prompt)}")
|
| 266 |
|
| 267 |
print(f"=" * 50)
|
| 268 |
response = siliconflow_qwen_generate_content("what is autism")
|
|
|
|
| 260 |
# logger.error(f"api of weaviate is not working")
|
| 261 |
# client.close()
|
| 262 |
|
| 263 |
+
# gen_prompt = Prompt_template_LLM_Generation.format(
|
| 264 |
+
# new_query="what is autism")
|
| 265 |
+
# logger.info(f"groq qwen generate.....: {groq_qwen_generate_content(gen_prompt)}")
|
| 266 |
|
| 267 |
print(f"=" * 50)
|
| 268 |
response = siliconflow_qwen_generate_content("what is autism")
|
src/config.py
CHANGED
|
@@ -148,39 +148,45 @@ class Config:
|
|
| 148 |
performance_config = self.get('performance', {})
|
| 149 |
if performance_config:
|
| 150 |
rag_config.update(performance_config)
|
| 151 |
-
|
| 152 |
return rag_config
|
| 153 |
|
| 154 |
@property
|
| 155 |
def groq_api_key(self) -> str:
|
| 156 |
-
"""Get Groq API key from environment."""
|
| 157 |
GROQ_API_KEY=os.getenv('GROQ_API_KEY', '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')
|
| 158 |
-
|
|
|
|
|
|
|
| 159 |
|
| 160 |
@property
|
| 161 |
def groq_url(self) -> str:
|
| 162 |
"""Get Groq URL from environment or config."""
|
|
|
|
|
|
|
|
|
|
| 163 |
return self.get('groq_url', 'https://api.groq.com/openai/v1')
|
| 164 |
|
| 165 |
@property
|
| 166 |
def siliconflow_api_key(self) -> str:
|
| 167 |
"""Get Silicon Flow API key from environment."""
|
| 168 |
SILICONFLOW_API_KEY= os.getenv('SILICONFLOW_API_KEY', 'sk-mamyyymhoyklygepxyaazxpxiaphjjbbynxgdrzebbmusmwl')
|
| 169 |
-
|
|
|
|
|
|
|
| 170 |
|
| 171 |
@property
|
| 172 |
-
def qdrant_url(self) -> str:
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
return self.get('vector_store.qdrant_url', 'http://localhost:6333')
|
| 178 |
|
| 179 |
@property
|
| 180 |
def qdrant_api_key(self) -> str:
|
| 181 |
"""Get Qdrant API key from environment."""
|
| 182 |
QDRANT_API_KEY=os.getenv('QDRANT_API_KEY', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOiJtIn0.L6Xwubquqwa9CXj3kVn9jiv64Cbe85vRdLv_LltuzZg')
|
| 183 |
-
|
|
|
|
|
|
|
| 184 |
|
| 185 |
@property
|
| 186 |
def document_processing_config(self) -> Dict[str, Any]:
|
|
|
|
| 148 |
performance_config = self.get('performance', {})
|
| 149 |
if performance_config:
|
| 150 |
rag_config.update(performance_config)
|
|
|
|
| 151 |
return rag_config
|
| 152 |
|
| 153 |
@property
|
| 154 |
def groq_api_key(self) -> str:
|
|
|
|
| 155 |
GROQ_API_KEY=os.getenv('GROQ_API_KEY', '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')
|
| 156 |
+
if GROQ_API_KEY:
|
| 157 |
+
return GROQ_API_KEY
|
| 158 |
+
return self.get('groq_api_key', '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')
|
| 159 |
|
| 160 |
@property
|
| 161 |
def groq_url(self) -> str:
|
| 162 |
"""Get Groq URL from environment or config."""
|
| 163 |
+
GROQ_URL = os.getenv('GROQ_URL', 'https://api.groq.com/openai/v1')
|
| 164 |
+
if GROQ_URL:
|
| 165 |
+
return GROQ_URL
|
| 166 |
return self.get('groq_url', 'https://api.groq.com/openai/v1')
|
| 167 |
|
| 168 |
@property
|
| 169 |
def siliconflow_api_key(self) -> str:
|
| 170 |
"""Get Silicon Flow API key from environment."""
|
| 171 |
SILICONFLOW_API_KEY= os.getenv('SILICONFLOW_API_KEY', 'sk-mamyyymhoyklygepxyaazxpxiaphjjbbynxgdrzebbmusmwl')
|
| 172 |
+
if SILICONFLOW_API_KEY:
|
| 173 |
+
return SILICONFLOW_API_KEY
|
| 174 |
+
return self.get('siliconflow_api_key', 'sk-mamyyymhoyklygepxyaazxpxiaphjjbbynxgdrzebbmusmwl')
|
| 175 |
|
| 176 |
@property
|
| 177 |
+
def qdrant_url(self) -> str:
|
| 178 |
+
QDRANT_URL = os.getenv('QDRANT_URL', "https://50f53cc8-bbb0-4939-8254-8f025a577222.us-west-2-0.aws.cloud.qdrant.io")
|
| 179 |
+
if QDRANT_URL:
|
| 180 |
+
return QDRANT_URL
|
| 181 |
+
return self.get('qdrant_url', "https://50f53cc8-bbb0-4939-8254-8f025a577222.us-west-2-0.aws.cloud.qdrant.io")
|
|
|
|
| 182 |
|
| 183 |
@property
|
| 184 |
def qdrant_api_key(self) -> str:
|
| 185 |
"""Get Qdrant API key from environment."""
|
| 186 |
QDRANT_API_KEY=os.getenv('QDRANT_API_KEY', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOiJtIn0.L6Xwubquqwa9CXj3kVn9jiv64Cbe85vRdLv_LltuzZg')
|
| 187 |
+
if QDRANT_API_KEY:
|
| 188 |
+
return QDRANT_API_KEY
|
| 189 |
+
return self.get('qdrant_api_key', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOiJtIn0.L6Xwubquqwa9CXj3kVn9jiv64Cbe85vRdLv_LltuzZg')
|
| 190 |
|
| 191 |
@property
|
| 192 |
def document_processing_config(self) -> Dict[str, Any]:
|