opencode-skills-collection 3.1.9 → 3.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +8 -1
- package/bundled-skills/browser-testing-with-devtools/SKILL.md +334 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/sources/sources.md +4 -0
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/drizzle-migration-conflict/SKILL.md +179 -0
- package/bundled-skills/drizzle-migration-conflict/references/ci-policy.md +87 -0
- package/bundled-skills/drizzle-migration-conflict/references/conflict-resolution.md +163 -0
- package/bundled-skills/drizzle-migration-conflict/references/report-template.md +69 -0
- package/bundled-skills/drizzle-migration-conflict/references/sources.md +51 -0
- package/bundled-skills/drizzle-migration-conflict/scripts/check_drizzle_migrations.py +721 -0
- package/bundled-skills/frontend-lighthouse/SKILL.md +348 -0
- package/bundled-skills/pre-release-review/SKILL.md +198 -0
- package/bundled-skills/pre-release-review/references/checklist.md +104 -0
- package/bundled-skills/pre-release-review/references/report-template.md +91 -0
- package/bundled-skills/re-create/SKILL.md +251 -0
- package/bundled-skills/weaviate/SKILL.md +132 -0
- package/bundled-skills/weaviate/references/ask.md +36 -0
- package/bundled-skills/weaviate/references/create_collection.md +152 -0
- package/bundled-skills/weaviate/references/environment_requirements.md +34 -0
- package/bundled-skills/weaviate/references/example_data.md +24 -0
- package/bundled-skills/weaviate/references/explore_collection.md +50 -0
- package/bundled-skills/weaviate/references/fetch_filter.md +88 -0
- package/bundled-skills/weaviate/references/get_collection.md +32 -0
- package/bundled-skills/weaviate/references/hybrid_search.md +47 -0
- package/bundled-skills/weaviate/references/import_data.md +160 -0
- package/bundled-skills/weaviate/references/keyword_search.md +38 -0
- package/bundled-skills/weaviate/references/list_collections.md +31 -0
- package/bundled-skills/weaviate/references/query_search.md +38 -0
- package/bundled-skills/weaviate/references/semantic_search.md +46 -0
- package/bundled-skills/weaviate/scripts/ask.py +106 -0
- package/bundled-skills/weaviate/scripts/create_collection.py +359 -0
- package/bundled-skills/weaviate/scripts/example_data.py +945 -0
- package/bundled-skills/weaviate/scripts/explore_collection.py +295 -0
- package/bundled-skills/weaviate/scripts/fetch_filter.py +261 -0
- package/bundled-skills/weaviate/scripts/get_collection.py +122 -0
- package/bundled-skills/weaviate/scripts/hybrid_search.py +157 -0
- package/bundled-skills/weaviate/scripts/import.py +701 -0
- package/bundled-skills/weaviate/scripts/keyword_search.py +142 -0
- package/bundled-skills/weaviate/scripts/list_collections.py +77 -0
- package/bundled-skills/weaviate/scripts/query_search.py +135 -0
- package/bundled-skills/weaviate/scripts/semantic_search.py +139 -0
- package/bundled-skills/weaviate/scripts/weaviate_conn.py +231 -0
- package/bundled-skills/weaviate-cookbooks/SKILL.md +67 -0
- package/bundled-skills/weaviate-cookbooks/references/advanced_rag.md +274 -0
- package/bundled-skills/weaviate-cookbooks/references/agentic_rag.md +360 -0
- package/bundled-skills/weaviate-cookbooks/references/async_client.md +428 -0
- package/bundled-skills/weaviate-cookbooks/references/basic_agent.md +270 -0
- package/bundled-skills/weaviate-cookbooks/references/basic_rag.md +219 -0
- package/bundled-skills/weaviate-cookbooks/references/data_explorer.md +336 -0
- package/bundled-skills/weaviate-cookbooks/references/environment_requirements.md +78 -0
- package/bundled-skills/weaviate-cookbooks/references/frontend_interface.md +104 -0
- package/bundled-skills/weaviate-cookbooks/references/pdf_multimodal_rag.md +635 -0
- package/bundled-skills/weaviate-cookbooks/references/project_setup.md +75 -0
- package/bundled-skills/weaviate-cookbooks/references/query_agent_chatbot.md +163 -0
- package/package.json +1 -1
- package/skills_index.json +156 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# /// script
|
|
3
|
+
# dependencies = [
|
|
4
|
+
# "weaviate-client==4.19.2",
|
|
5
|
+
# "typer==0.21.0",
|
|
6
|
+
# ]
|
|
7
|
+
# ///
|
|
8
|
+
"""
|
|
9
|
+
Hybrid search on a Weaviate collection (combines vector and keyword search).
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
uv run hybrid_search.py --query "your query" --collection "CollectionName" [--alpha 0.5] [--limit 10] [--json]
|
|
13
|
+
|
|
14
|
+
Environment Variables:
|
|
15
|
+
WEAVIATE_URL: Weaviate Cloud cluster URL
|
|
16
|
+
WEAVIATE_API_KEY: API key for authentication
|
|
17
|
+
+ Any provider API keys (OPENAI_API_KEY, COHERE_API_KEY, etc.) - auto-detected
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import json
|
|
21
|
+
import sys
|
|
22
|
+
|
|
23
|
+
import typer
|
|
24
|
+
import weaviate
|
|
25
|
+
from weaviate.classes.query import MetadataQuery
|
|
26
|
+
|
|
27
|
+
# Import shared connection utilities (local to this skill)
|
|
28
|
+
from weaviate_conn import get_client
|
|
29
|
+
|
|
30
|
+
app = typer.Typer()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def parse_properties(properties_str: str | None) -> list[str] | None:
|
|
34
|
+
"""Parse comma-separated property names."""
|
|
35
|
+
if not properties_str:
|
|
36
|
+
return None
|
|
37
|
+
return [p.strip() for p in properties_str.split(",") if p.strip()]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@app.command()
|
|
41
|
+
def main(
|
|
42
|
+
query: str = typer.Option(..., "--query", "-q", help="Search query text"),
|
|
43
|
+
collection: str = typer.Option(..., "--collection", "-c", help="Collection name"),
|
|
44
|
+
alpha: float = typer.Option(
|
|
45
|
+
0.7,
|
|
46
|
+
"--alpha",
|
|
47
|
+
"-a",
|
|
48
|
+
help="Balance: 1.0=vector only, 0.0=keyword only (default: 0.7)",
|
|
49
|
+
),
|
|
50
|
+
limit: int = typer.Option(10, "--limit", "-l", help="Maximum results to return"),
|
|
51
|
+
properties: str = typer.Option(
|
|
52
|
+
None, "--properties", "-p", help="Comma-separated properties to search"
|
|
53
|
+
),
|
|
54
|
+
target_vector: str = typer.Option(
|
|
55
|
+
None,
|
|
56
|
+
"--target-vector",
|
|
57
|
+
"-t",
|
|
58
|
+
help="Target vector name for named vector collections",
|
|
59
|
+
),
|
|
60
|
+
json_output: bool = typer.Option(False, "--json", help="Output in JSON format"),
|
|
61
|
+
):
|
|
62
|
+
"""Perform hybrid search (vector + keyword) on a Weaviate collection."""
|
|
63
|
+
query_properties = parse_properties(properties)
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
with get_client() as client:
|
|
67
|
+
if not client.collections.exists(collection):
|
|
68
|
+
print(f"Error: Collection '{collection}' not found.", file=sys.stderr)
|
|
69
|
+
raise typer.Exit(1)
|
|
70
|
+
|
|
71
|
+
coll = client.collections.use(collection)
|
|
72
|
+
|
|
73
|
+
print("Searching...", file=sys.stderr)
|
|
74
|
+
response = coll.query.hybrid(
|
|
75
|
+
query=query,
|
|
76
|
+
alpha=alpha,
|
|
77
|
+
limit=limit,
|
|
78
|
+
query_properties=query_properties,
|
|
79
|
+
target_vector=target_vector,
|
|
80
|
+
return_metadata=MetadataQuery(score=True, explain_score=True),
|
|
81
|
+
)
|
|
82
|
+
print("Done.", file=sys.stderr)
|
|
83
|
+
|
|
84
|
+
objects = []
|
|
85
|
+
for obj in response.objects:
|
|
86
|
+
obj_data = {
|
|
87
|
+
"uuid": str(obj.uuid),
|
|
88
|
+
"properties": dict(obj.properties),
|
|
89
|
+
"score": obj.metadata.score if obj.metadata else None,
|
|
90
|
+
"explain_score": obj.metadata.explain_score
|
|
91
|
+
if obj.metadata
|
|
92
|
+
else None,
|
|
93
|
+
}
|
|
94
|
+
objects.append(obj_data)
|
|
95
|
+
|
|
96
|
+
result = {
|
|
97
|
+
"query": query,
|
|
98
|
+
"collection": collection,
|
|
99
|
+
"alpha": alpha,
|
|
100
|
+
"limit": limit,
|
|
101
|
+
"target_vector": target_vector,
|
|
102
|
+
"objects": objects,
|
|
103
|
+
"object_count": len(objects),
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if json_output:
|
|
107
|
+
print(json.dumps(result, indent=2, default=str))
|
|
108
|
+
else:
|
|
109
|
+
print(f"## Hybrid Search Results\n")
|
|
110
|
+
print(f"**Query:** {query}")
|
|
111
|
+
print(f"**Collection:** {collection}")
|
|
112
|
+
print(f"**Alpha:** {alpha} (1=vector, 0=keyword)")
|
|
113
|
+
print(f"**Found:** {len(objects)} objects\n")
|
|
114
|
+
|
|
115
|
+
if objects:
|
|
116
|
+
all_props = set()
|
|
117
|
+
for obj in objects:
|
|
118
|
+
all_props.update(obj.get("properties", {}).keys())
|
|
119
|
+
sorted_props = sorted(list(all_props))
|
|
120
|
+
|
|
121
|
+
headers = ["#", "UUID", "Score"] + sorted_props
|
|
122
|
+
header_row = "| " + " | ".join(headers) + " |"
|
|
123
|
+
separator_row = "| " + " | ".join(["---"] * len(headers)) + " |"
|
|
124
|
+
|
|
125
|
+
print(header_row)
|
|
126
|
+
print(separator_row)
|
|
127
|
+
|
|
128
|
+
for idx, obj in enumerate(objects, 1):
|
|
129
|
+
score = obj.get("score")
|
|
130
|
+
score_str = f"{score:.4f}" if score is not None else "N/A"
|
|
131
|
+
row_data = [
|
|
132
|
+
str(idx),
|
|
133
|
+
str(obj.get("uuid", "N/A")),
|
|
134
|
+
score_str,
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
props = obj.get("properties", {})
|
|
138
|
+
for prop in sorted_props:
|
|
139
|
+
val = props.get(prop, "-")
|
|
140
|
+
val_str = str(val).replace("\n", " ").replace("|", "\\|")
|
|
141
|
+
row_data.append(val_str)
|
|
142
|
+
|
|
143
|
+
print("| " + " | ".join(row_data) + " |")
|
|
144
|
+
print()
|
|
145
|
+
else:
|
|
146
|
+
print("No objects found matching the query.\n")
|
|
147
|
+
|
|
148
|
+
except weaviate.exceptions.WeaviateConnectionError as e:
|
|
149
|
+
print(f"Error: Connection failed - {e}", file=sys.stderr)
|
|
150
|
+
raise typer.Exit(1)
|
|
151
|
+
except Exception as e:
|
|
152
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
153
|
+
raise typer.Exit(1)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
if __name__ == "__main__":
|
|
157
|
+
app()
|