-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for streaming and fixes few issues (see description) (#202)
- Loading branch information
Showing
45 changed files
with
2,274 additions
and
485 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: e2e tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Run tests on pushes to the main branch | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export PATH="$HOME/.local/bin:$PATH" | ||
- name: Run e2e tests | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | ||
run: | | ||
cd e2e_tests && bash run_e2e_tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run Model Server tests | ||
name: model server tests | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: rust tests (prompt and llm gateway) | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./crates | ||
|
||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | Rust | ||
run: rustup toolchain install stable --profile minimal | ||
|
||
- name: Setup | Install wasm toolchain | ||
run: rustup target add wasm32-wasi | ||
|
||
- name: Build wasm module | ||
run: cargo build --release --target=wasm32-wasi | ||
|
||
- name: Run unit tests | ||
run: cargo test --lib | ||
|
||
- name: Run integration tests | ||
run: cargo test --test integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ arch_logs/ | |
dist/ | ||
crates/*/target/ | ||
crates/target/ | ||
build.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,4 +160,3 @@ required: | |
- version | ||
- listener | ||
- llm_providers | ||
- prompt_targets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
docker build -t archgw .. -f Dockerfile | ||
docker build -f Dockerfile .. -t katanemo/archgw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
archgw: | ||
image: katanemo/archgw:latest | ||
ports: | ||
- "10000:10000" | ||
- "11000:11000" | ||
- "12000:12000" | ||
- "19901:9901" | ||
volumes: | ||
- ${ARCH_CONFIG_FILE:-../demos/function_calling/arch_config.yaml}:/config/arch_config.yaml | ||
- /etc/ssl/cert.pem:/etc/ssl/cert.pem | ||
- ~/archgw_logs:/var/log/ | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
environment: | ||
- OPENAI_API_KEY=${OPENAI_API_KEY:?error} | ||
- MISTRAL_API_KEY=${MISTRAL_API_KEY:?error} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import json | ||
|
||
|
||
ARCH_STATE_HEADER = "x-arch-state" | ||
|
||
|
||
def get_arch_messages(response_json): | ||
arch_messages = [] | ||
if response_json and "metadata" in response_json: | ||
# load arch_state from metadata | ||
arch_state_str = response_json.get("metadata", {}).get(ARCH_STATE_HEADER, "{}") | ||
# parse arch_state into json object | ||
arch_state = json.loads(arch_state_str) | ||
# load messages from arch_state | ||
arch_messages_str = arch_state.get("messages", "[]") | ||
# parse messages into json object | ||
arch_messages = json.loads(arch_messages_str) | ||
# append messages from arch gateway to history | ||
return arch_messages | ||
return [] |
Oops, something went wrong.