Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kemingy
Copy link
Member

@kemingy kemingy commented Jun 30, 2025

To start a vechord dynamic pipeline service:

import uvicorn

from vechord.registry import VechordRegistry
from vechord.service import create_web_app

if __name__ == "__main__":
    vr = VechordRegistry("run", "postgresql://postgres:[email protected]:5432/")
    app = create_web_app(vr)
    uvicorn.run(app)

@kemingy kemingy requested a review from Copilot June 30, 2025 07:53

This comment was marked as outdated.

kemingy added 3 commits June 30, 2025 16:04
Signed-off-by: Keming <[email protected]>
Signed-off-by: Keming <[email protected]>
@kemingy kemingy marked this pull request as ready for review July 1, 2025 03:28
Signed-off-by: Keming <[email protected]>
@kemingy
Copy link
Member Author

kemingy commented Jul 1, 2025

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

@kemingy kemingy requested a review from Copilot July 1, 2025 03:38
Copy link
Contributor

Copilot AI left a 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 RunRequest and ResourceRequest models for pipeline configuration
  • Implement run_dynamic_pipeline and build_pipeline in vechord/pipeline.py
  • Register and expose the new /api/run Falcon endpoint in service.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_JSON or falcon.MEDIA_MSGPACK) before sending resp.data so 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 RunResource and run_dynamic_pipeline to cover both indexing and search pipelines, verifying request validation, error handling, and response encoding.
class RunResource:

@kemingy kemingy merged commit f291ad2 into tensorchord:main Jul 1, 2025
4 checks passed
@kemingy kemingy deleted the run_pipeline branch July 1, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant