feat(provider): add Qdrant Cloud REST provider - #218
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
Summary by CodeRabbit
WalkthroughAdds a Qdrant Cloud provider with seven collection and point actions, JSON-schema contracts, custom credential configuration, executor wiring, and a runtime for authenticated HTTP requests. The runtime validates cluster URLs and inputs, normalizes Qdrant responses and pagination, and maps transport, validation, timeout, and API errors. Tests cover request construction, credential validation, input rejection, pagination, URL validation, response envelopes, and error mapping. Sequence Diagram(s)sequenceDiagram
participant ProviderExecutor
participant qdrantActionHandlers
participant requestQdrantJson
participant QdrantCloudAPI
ProviderExecutor->>qdrantActionHandlers: execute Qdrant action
qdrantActionHandlers->>requestQdrantJson: construct authenticated request
requestQdrantJson->>QdrantCloudAPI: send HTTP request
QdrantCloudAPI-->>requestQdrantJson: return response envelope
requestQdrantJson-->>qdrantActionHandlers: return unwrapped result
qdrantActionHandlers-->>ProviderExecutor: return normalized output
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/providers/qdrant/executors.ts (1)
11-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse the exported
QdrantContexttype instead ofReturnType<typeof createQdrantContext>.
QdrantContextis already exported from./runtime.ts; referencing it directly is more readable than deriving it viaReturnType.♻️ Suggested refactor
-import { createQdrantContext, qdrantActionHandlers, validateQdrantCredential } from "./runtime.ts"; +import type { QdrantContext } from "./runtime.ts"; +import { createQdrantContext, qdrantActionHandlers, validateQdrantCredential } from "./runtime.ts"; @@ - async createContext(context: ExecutionContext, fetcher): Promise<ReturnType<typeof createQdrantContext>> { + async createContext(context: ExecutionContext, fetcher): Promise<QdrantContext> {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/providers/qdrant/executors.ts` around lines 11 - 14, Update the createContext method’s return type to use the exported QdrantContext type from ./runtime.ts instead of ReturnType<typeof createQdrantContext>, adding or adjusting the import as needed while preserving the existing implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/providers/qdrant/actions.ts`:
- Around line 12-17: Update the min_should field description in filterSchema to
describe the expected Qdrant object shape, including conditions and min_count,
rather than describing it as a standalone minimum number. Leave the other filter
fields unchanged.
---
Nitpick comments:
In `@src/providers/qdrant/executors.ts`:
- Around line 11-14: Update the createContext method’s return type to use the
exported QdrantContext type from ./runtime.ts instead of ReturnType<typeof
createQdrantContext>, adding or adjusting the import as needed while preserving
the existing implementation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fa5fc71c-e437-4835-bd46-12c027931654
📒 Files selected for processing (5)
src/providers/qdrant/actions.tssrc/providers/qdrant/definition.tssrc/providers/qdrant/executors.tssrc/providers/qdrant/runtime.test.tssrc/providers/qdrant/runtime.ts
|
已根据 review 完成修复并推送:对齐 Qdrant Point ID 的 schema 与运行时校验,保留并正确校验 collection name,修正 本地验证已通过: |
中文
概要
新增 Qdrant Cloud Provider,通过官方 REST API 提供 7 个可本地执行的向量数据库 Action:
qdrant.list_collectionsqdrant.get_collectionqdrant.create_collectionqdrant.upsert_pointsqdrant.get_pointqdrant.query_pointsqdrant.scroll_points主要变更
custom_credential,支持 Qdrant CloudclusterUrl和apiKey。GET /collections验证数据库访问权限。*.cloud.qdrant.io主机和6333端口。PUT .../points?wait=true请求,避免写入与可见性之间的竞态。验证
English
Summary
Add a locally executable Qdrant Cloud Provider backed by the official REST API with seven vector-database actions:
qdrant.list_collectionsqdrant.get_collectionqdrant.create_collectionqdrant.upsert_pointsqdrant.get_pointqdrant.query_pointsqdrant.scroll_pointsChanges
custom_credentialauthentication with Qdrant CloudclusterUrlandapiKey.GET /collectionsto verify database access.*.cloud.qdrant.iohosts, and port6333.PUT .../points?wait=truerequest for upserts to provide write visibility without a separate race-prone request.Verification
Scope Notes
This initial provider intentionally excludes self-hosted Qdrant, gRPC, named/sparse/multivectors, deletion operations, aliases, snapshots, payload indexes, and arbitrary endpoint proxying.