MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / load_config

Function load_config

agent/run_ai_agent.py:12–29  ·  view source on GitHub ↗

加载配置文件

()

Source from the content-addressed store, hash-verified

10from recipe_ai_agent import LLMRecipeAgent, RecipeKnowledgeGraphBuilder
11
12def load_config():
13 """加载配置文件"""
14 config_file = "config.json"
15 if os.path.exists(config_file):
16 with open(config_file, 'r', encoding='utf-8') as f:
17 return json.load(f)
18 else:
19 print("警告: 未找到config.json配置文件,将使用默认配置")
20 return {
21 "openai": {
22 "api_key": "",
23 "base_url": "https://api.openai.com/v1"
24 },
25 "output": {
26 "format": "neo4j",
27 "directory": "./ai_output"
28 }
29 }
30
31def setup_api_key():
32 """设置API密钥"""

Callers 2

test_single_recipeFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_single_recipeFunction · 0.56