-
Notifications
You must be signed in to change notification settings - Fork 5
feat: support run defined pipeline from config #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
|
A demo request: import httpx
import msgspec
ingest = dict(
name="ragusa",
data="hello \n world".encode("utf-8"),
steps=[
{
"kind": "chunk",
"provider": "regex",
"args": {
"size": 5,
"overlap": 0,
}
},
{
"kind": "embedding",
"provider": "gemini",
"args": {
"api_key": "***"
}
},
{
"kind": "index",
"provider": "vectorchord",
"args": {
"vector": {
"nlist": 1,
"distance": "cos",
}
}
}
]
)
search = dict(
name="ragusa",
data="hi there".encode("utf-8"),
steps=[
{
"kind": "embedding",
"provider": "gemini",
"args": {
"api_key": "***"
}
},
{
"kind": "search",
"provider": "vectorchord",
"args": {
"vector": {
"topk": 1,
}
}
}
]
)
for req in (ingest, search):
resp = httpx.post(
url="http://localhost:8000/api/run",
headers={"Content-Type": "application/msgpack"},
content=msgspec.msgpack.encode(req)
)
print(resp)
print(msgspec.msgpack.decode(resp.content))cc @xieydd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for defining and running dynamic pipelines via a new /api/run endpoint driven by a JSON/msgpack configuration. Key changes include schema updates, pipeline builder implementation, and async extractor adjustments.
- Introduce
RunRequestandResourceRequestmodels for pipeline configuration - Implement
run_dynamic_pipelineandbuild_pipelineinvechord/pipeline.py - Register and expose the new
/api/runFalcon endpoint inservice.py
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vechord/service.py | Add RunResource, validate and route dynamic pipeline runs |
| vechord/pipeline.py | New dynamic pipeline builder and executor logic |
| vechord/model.py | Define ResourceRequest and RunRequest structures |
| vechord/rerank.py | Require and inject COHERE_API_KEY for async reranking |
| vechord/registry.py | Update init_table_index signature and imports |
| vechord/extract.py | Convert extractors to async and update Gemini client use |
| tests/test_table.py | Add a test case for optional keyword in chunks |
Comments suppressed due to low confidence (2)
vechord/service.py:135
- Set
resp.content_type(e.g.,falcon.MEDIA_JSONorfalcon.MEDIA_MSGPACK) before sendingresp.dataso clients can correctly interpret the response payload.
resp.data = encoder.encode(res, enc_hook=vechord_encode_hook)
vechord/service.py:120
- [nitpick] Add tests for
RunResourceandrun_dynamic_pipelineto cover both indexing and search pipelines, verifying request validation, error handling, and response encoding.
class RunResource:
Co-authored-by: Copilot <[email protected]> Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
To start a vechord dynamic pipeline service: