Merge branch 'main' of https://git.ttcorp.net/admin/orangepi-rag
Merge manual edit
This commit is contained in:
@@ -1,14 +1,10 @@
|
|||||||
# LLM API Configuration
|
# LLM API Configuration
|
||||||
# Get your API key from:
|
# Get your API key from https://platform.openai.com/api-keys
|
||||||
# - OpenAI: https://platform.openai.com/api-keys
|
# Or use any OpenAI-compatible API (e.g., Together.ai, Groq, etc.)
|
||||||
# - Together.ai: https://api.together.xyz/settings/api-keys
|
OPENAI_API_KEY=sk-QHX7EZodq0EBuJyRX
|
||||||
# - Groq: https://console.groq.com/keys
|
|
||||||
# - Or any OpenAI-compatible API
|
|
||||||
|
|
||||||
OPENAI_API_KEY=your_api_key_here
|
|
||||||
|
|
||||||
# Optional: Custom base URL for OpenAI-compatible APIs
|
# Optional: Custom base URL for OpenAI-compatible APIs
|
||||||
# LLM_BASE_URL=https://api.openai.com/v1
|
LLM_BASE_URL=http://192.168.88.5:8317/v1
|
||||||
|
|
||||||
# Optional: Model name (default: gpt-4o-mini)
|
# Optional: Model name (default: gpt-4o-mini)
|
||||||
# LLM_MODEL=gpt-4o-mini
|
LLM_MODEL=gpt-5.4-mini
|
||||||
+13
-1
@@ -284,8 +284,20 @@ def main():
|
|||||||
print("ERROR: Set OPENAI_API_KEY or LLM_API_KEY in environment or .env file")
|
print("ERROR: Set OPENAI_API_KEY or LLM_API_KEY in environment or .env file")
|
||||||
print(" Or use --retrieve-only to test retrieval without LLM")
|
print(" Or use --retrieve-only to test retrieval without LLM")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
llm_base_url = os.environ.get("LLM_BASE_URL") or args.llm_base_url
|
||||||
|
if not llm_base_url:
|
||||||
|
print("ERROR: Set LLM_BASE_URL or --llm_base_url in environment or .env file")
|
||||||
|
print(" Or use --retrieve-only to test retrieval without LLM")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
llm_model = os.environ.get("LLM_MODEL") or args.llm_model
|
||||||
|
if not llm_model:
|
||||||
|
print("ERROR: Set LLM_MODEL or --llm_model in environment or .env file")
|
||||||
|
print(" Or use --retrieve-only to test retrieval without LLM")
|
||||||
|
return 1
|
||||||
|
|
||||||
llm = LLMClient(api_key, args.llm_base_url, args.llm_model)
|
llm = LLMClient(api_key, llm_base_url, llm_model)
|
||||||
pipeline = RAGPipeline(args.data_dir, args.index_dir, embedder, llm, args.top_k)
|
pipeline = RAGPipeline(args.data_dir, args.index_dir, embedder, llm, args.top_k)
|
||||||
|
|
||||||
if args.build:
|
if args.build:
|
||||||
|
|||||||
Reference in New Issue
Block a user