mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-28 21:01:55 +08:00
32 lines
683 B
Python
32 lines
683 B
Python
"""
|
|
depth_search_graph_opeani example
|
|
"""
|
|
import os
|
|
from dotenv import load_dotenv
|
|
from scrapegraphai.graphs import DepthSearchGraph
|
|
|
|
load_dotenv()
|
|
|
|
openai_key = os.getenv("OPENAI_APIKEY")
|
|
|
|
graph_config = {
|
|
"llm": {
|
|
"api_key": "***************************",
|
|
"model": "oneapi/qwen-turbo",
|
|
"base_url": "http://127.0.0.1:3000/v1", # 设置 OneAPI URL
|
|
},
|
|
"verbose": True,
|
|
"headless": False,
|
|
"depth": 2,
|
|
"only_inside_links": False,
|
|
}
|
|
|
|
search_graph = DepthSearchGraph(
|
|
prompt="List me all the projects with their description",
|
|
source="https://perinim.github.io",
|
|
config=graph_config
|
|
)
|
|
|
|
result = search_graph.run()
|
|
print(result)
|