Browse Source

Fix small typo and add dependency for dora openai server

tags/v0.3.7rc0
haixuanTao 1 year ago
parent
commit
05056f7fce
6 changed files with 6 additions and 4 deletions
  1. +0
    -0
      examples/openai-server/.gitignore
  2. +1
    -1
      examples/openai-server/README.md
  3. +0
    -0
      examples/openai-server/dataflow.yml
  4. +0
    -1
      examples/openai-server/openai_api_client.py
  5. +1
    -2
      node-hub/dora-openai-server/dora_openai_server/main.py
  6. +4
    -0
      node-hub/dora-openai-server/pyproject.toml

examples/openai-server-example/.gitignore → examples/openai-server/.gitignore View File


examples/openai-server-example/README.md → examples/openai-server/README.md View File

@@ -12,6 +12,6 @@ dora build dataflow.yml
dora start dataflow.yml

# In a separate terminal
python api_client.py
python openai_api_client.py
dora stop
```

examples/openai-server-example/dataflow.yml → examples/openai-server/dataflow.yml View File


examples/openai-server-example/api_client.py → examples/openai-server/openai_api_client.py View File

@@ -1,5 +1,4 @@
from openai import OpenAI
import os

client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy_api_key")


+ 1
- 2
node-hub/dora-openai-server/dora_openai_server/main.py View File

@@ -33,8 +33,7 @@ class ChatCompletionResponse(BaseModel):
usage: dict


if not os.getenv("PYTEST_CURRENT_TEST"):
node = Node() # provide the name to connect to the dataflow if dynamic node
node = Node() # provide the name to connect to the dataflow if dynamic node


@app.post("/v1/chat/completions")


+ 4
- 0
node-hub/dora-openai-server/pyproject.toml View File

@@ -17,6 +17,10 @@ dora-rs = "^0.3.6"
numpy = "< 2.0.0"
pyarrow = ">= 5.0.0"
python = "^3.7"
fastapi = "^0.115"
asyncio = "^3.4"
uvicorn = "^0.31"
pydantic = "^2.9"

[tool.poetry.scripts]
dora-openai-server = "dora_openai_server.main:main"


Loading…
Cancel
Save