|
1 | 1 | import logging |
2 | 2 | import os |
3 | | -import glob |
4 | 3 |
|
5 | 4 | from deepsearcher.offline_loading import load_from_local_files |
6 | 5 | from deepsearcher.online_query import query |
|
12 | 11 | current_dir = os.path.dirname(os.path.abspath(__file__)) |
13 | 12 |
|
14 | 13 | config = Configuration() # Customize your config here |
15 | | -config.set_provider_config("llm", "JiekouAI", {"model": "claude-sonnet-4-5-20250929"}) |
16 | | -config.set_provider_config("embedding", "JiekouAIEmbedding", {"model": "qwen/qwen3-embedding-8b"}) |
17 | 14 | init_config(config=config) |
18 | 15 |
|
19 | 16 |
|
|
26 | 23 |
|
27 | 24 | # Hint: You can also load a single file, please execute it in the root directory of the deep searcher project |
28 | 25 | load_from_local_files( |
29 | | - paths_or_directory='/Users/jason/Documents/work/PPLabs/Platform/deep-searcher/examples/data/car_company_data.pdf', |
30 | | - collection_name="car_company_data", |
31 | | - collection_description="car_company_data", |
32 | | - force_new_collection=True, # If you want to drop origin collection and create a new collection every time, set force_new_collection to True |
| 26 | + paths_or_directory=os.path.join(current_dir, "data/WhatisMilvus.pdf"), |
| 27 | + collection_name="milvus_docs", |
| 28 | + collection_description="All Milvus Documents", |
| 29 | + # force_new_collection=True, # If you want to drop origin collection and create a new collection every time, set force_new_collection to True |
33 | 30 | ) |
34 | 31 |
|
35 | | -question = """请从财务和宏观经济角度,对 A 股新能源汽车行业以及行业内 TOP5 车企的发展进行分析。在财务分析部分,需涵盖基本的财务关键指标。 |
36 | | -在宏观经济分析部分,考虑宏观经济指标对行业的影响,对 A 股新能源汽车行业整体发展趋势进行总结,并基于财务和宏观经济分析,对 TOP5 新能源车企的未来发展潜力和竞争态势做出比较和预测,指出各车企的优势与挑战。请以专业、严谨的语言,结合具体数据进行分析阐述。 |
37 | | -""" |
| 32 | +question = "Write a report comparing Milvus with other vector databases." |
38 | 33 |
|
39 | 34 | _, _, consumed_token = query(question, max_iter=1) |
40 | 35 | print(f"Consumed tokens: {consumed_token}") |
0 commit comments