-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Your Question
我将一段文本导入到resource中,导入是成功的:
为什么用find方法找不到任何结果,我搜索的Webapp关键字在导入的文本中是大量出现的。
而且我指定了target_uri为viking://resources/docs/chunk_OV2-50254,为什么结果中反而会出现viking://agent/instructions目录的结果:
(Test) PS D:\Research\OpenViking> python example.py
Resource added at: viking://resources/docs/chunk_OV2-50254
Wait for semantic processing...
Search results:
viking://agent/instructions (score: 0.1150)
Context
No response
Code Example (Optional)
import openviking as ov
# Initialize OpenViking client with data directory
client = ov.SyncOpenViking(path="./data")
try:
# Initialize the client
client.initialize()
# Add resource (supports URL, file, or directory)
# add_result = client.add_resource(
# path="https://raw.githubusercontent.com/volcengine/OpenViking/refs/heads/main/README.md"
# )
scope = "viking://resources/docs/"
add_result = client.add_resource(
"D:\\Research\\OpenViking\\chunk_OV2-50254.txt",
reason="项目技术文档",
target=scope
)
root_uri = add_result['root_uri']
print(f"Resource added at: {root_uri}\n")
# # Wait for semantic processing to complete
print("Wait for semantic processing...")
client.wait_processed()
# Perform semantic search
results = client.find("Webapp", target_uri=root_uri)
print("Search results:")
for r in results.resources:
print(f" {r.uri} (score: {r.score:.4f})")
# Close the client
client.close()
except Exception as e:
print(f"Error: {e}")Related Area
None
Before Asking
- I have checked the documentation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested