Skip to content

Commit

Permalink
feat: bumped to DIAL 1.8 and aidial-sdk 0.8.0 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed May 9, 2024
1 parent 4398663 commit da06e08
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dial-docker-compose/addon/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ include:

services:
adapter-openai:
image: epam/ai-dial-adapter-openai:0.7.0
image: epam/ai-dial-adapter-openai:0.11.0
environment:
WEB_CONCURRENCY: "3"

assistant:
image: epam/ai-dial-assistant:0.6.0
image: epam/ai-dial-assistant:0.7.0
environment:
OPENAI_API_BASE: "http://core:8080"
WEB_CONCURRENCY: "3"
Expand Down
1 change: 1 addition & 0 deletions dial-docker-compose/ci/addon/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
environment:
DIAL_URL: "http://core:8080"
DIAL_API_KEY: "dial_api_key"
DIAL_API_VERSION: "2024-02-01"
depends_on:
azure_deployment_host:
condition: service_started
Expand Down
8 changes: 5 additions & 3 deletions dial-docker-compose/ci/addon/test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def get_env(name: str) -> str:

DIAL_URL = get_env("DIAL_URL")
DIAL_API_KEY = get_env("DIAL_API_KEY")
DIAL_API_VERSION = get_env("DIAL_API_VERSION")

logging.basicConfig(level=logging.DEBUG)

Expand All @@ -24,9 +25,9 @@ def get_env(name: str) -> str:
(aiohttp.ClientError, aiohttp.ServerTimeoutError),
max_time=60,
)
async def post_with_retry(url: str, payload: dict, headers: dict):
async def post_with_retry(url: str, payload: dict, headers: dict, params: dict):
async with aiohttp.ClientSession() as session:
async with session.post(url, json=payload, headers=headers) as response:
async with session.post(url, json=payload, headers=headers, params=params) as response:
response.raise_for_status()
return await response.json()

Expand All @@ -46,8 +47,9 @@ async def test_model(deployment_id: str, model: str):
"stream": False,
}
headers = {"api-key": DIAL_API_KEY}
params = {"api-version": DIAL_API_VERSION}

body = await post_with_retry(api_url, payload, headers)
body = await post_with_retry(api_url, payload, headers, params)

content = body.get("choices", [])[0].get("message", {}).get("content", "")
if content != expected_response:
Expand Down
1 change: 1 addition & 0 deletions dial-docker-compose/ci/application/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
environment:
DIAL_URL: "http://core:8080"
DIAL_API_KEY: "dial_api_key"
DIAL_API_VERSION: "2024-02-01"
depends_on:
echo:
condition: service_started
Expand Down
8 changes: 5 additions & 3 deletions dial-docker-compose/ci/application/test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def get_env(name: str) -> str:

DIAL_URL = get_env("DIAL_URL")
DIAL_API_KEY = get_env("DIAL_API_KEY")
DIAL_API_VERSION = get_env("DIAL_API_VERSION")

logging.basicConfig(level=logging.DEBUG)

Expand All @@ -24,9 +25,9 @@ def get_env(name: str) -> str:
(aiohttp.ClientError, aiohttp.ServerTimeoutError),
max_time=60,
)
async def post_with_retry(url: str, payload: dict, headers: dict):
async def post_with_retry(url: str, payload: dict, headers: dict, params: dict):
async with aiohttp.ClientSession() as session:
async with session.post(url, json=payload, headers=headers) as response:
async with session.post(url, json=payload, headers=headers, params=params) as response:
response.raise_for_status()
return await response.json()

Expand All @@ -37,8 +38,9 @@ async def test_model(deployment_id: str):
message = "Hello"
payload = {"messages": [{"role": "user", "content": message}], "stream": False}
headers = {"api-key": DIAL_API_KEY}
params = {"api-version": DIAL_API_VERSION}

body = await post_with_retry(api_url, payload, headers)
body = await post_with_retry(api_url, payload, headers, params)

content = body.get("choices", [])[0].get("message", {}).get("content", "")
if content != message:
Expand Down
1 change: 1 addition & 0 deletions dial-docker-compose/ci/model/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
environment:
DIAL_URL: "http://core:8080"
DIAL_API_KEY: "dial_api_key"
DIAL_API_VERSION: "2024-02-01"
depends_on:
adapter-openai:
condition: service_started
Expand Down
8 changes: 5 additions & 3 deletions dial-docker-compose/ci/model/test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def get_env(name: str) -> str:

DIAL_URL = get_env("DIAL_URL")
DIAL_API_KEY = get_env("DIAL_API_KEY")
DIAL_API_VERSION = get_env("DIAL_API_VERSION")

logging.basicConfig(level=logging.DEBUG)

Expand All @@ -24,9 +25,9 @@ def get_env(name: str) -> str:
(aiohttp.ClientError, aiohttp.ServerTimeoutError),
max_time=60,
)
async def post_with_retry(url: str, payload: dict, headers: dict):
async def post_with_retry(url: str, payload: dict, headers: dict, params: dict):
async with aiohttp.ClientSession() as session:
async with session.post(url, json=payload, headers=headers) as response:
async with session.post(url, json=payload, headers=headers, params=params) as response:
response.raise_for_status()
return await response.json()

Expand All @@ -37,8 +38,9 @@ async def test_model(deployment_id: str):
message = "Hello"
payload = {"messages": [{"role": "user", "content": message}], "stream": False}
headers = {"api-key": DIAL_API_KEY}
params = {"api-version": DIAL_API_VERSION}

body = await post_with_retry(api_url, payload, headers)
body = await post_with_retry(api_url, payload, headers, params)

content = body.get("choices", [])[0].get("message", {}).get("content", "")
if content != message:
Expand Down
10 changes: 7 additions & 3 deletions dial-docker-compose/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ version: '3'

services:
themes:
image: epam/ai-dial-chat-themes:0.3.0
image: epam/ai-dial-chat-themes:0.4.0
ports:
- "3001:8080"

chat:
ports:
- "3000:3000"
image: epam/ai-dial-chat:0.5.1
image: epam/ai-dial-chat:0.10.0
depends_on:
- themes
- core
Expand Down Expand Up @@ -42,11 +42,15 @@ services:
environment:
'AIDIAL_SETTINGS': '/opt/settings/settings.json'
'JAVA_OPTS': '-Dgflog.config=/opt/settings/gflog.xml'
'LOG_DIR': '/app/log'
'STORAGE_DIR': '/app/data'
'aidial.config.files': '["/opt/config/config.json"]'
'aidial.storage.overrides': '{ "jclouds.filesystem.basedir": "data" }'
'aidial.redis.singleServerConfig.address': 'redis://redis:6379'
depends_on:
- redis
volumes:
- ./settings:/opt/settings
- ${DIAL_DIR:-.}/core:/opt/config
- ${DIAL_DIR:-.}/core-logs/:/app/log
- ${DIAL_DIR:-.}/core-logs/:/app/log
- ${DIAL_DIR:-.}/core-data/:/app/data
2 changes: 1 addition & 1 deletion dial-docker-compose/model/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ include:

services:
adapter-openai:
image: epam/ai-dial-adapter-openai:0.7.0
image: epam/ai-dial-adapter-openai:0.11.0
environment:
WEB_CONCURRENCY: "3"
2 changes: 1 addition & 1 deletion dial-sdk
Submodule dial-sdk updated 44 files
+2 −0 .github/CODEOWNERS
+1 −0 .github/ISSUE_TEMPLATE/config.yml
+9 −0 .github/dependabot.yml
+0 −14 .github/pr-title-checker-config.json
+0 −12 .github/workflows/integration_tests.yml
+14 −0 .github/workflows/pr-title-check.yml
+12 −0 .github/workflows/pr.yml
+0 −15 .github/workflows/pr_check_tests.yml
+3 −4 .github/workflows/release.yml
+1 −1 .github/workflows/slash-command-dispatch.yml
+11 −0 SECURITY.md
+110 −75 aidial_sdk/application.py
+12 −0 aidial_sdk/chat_completion/__init__.py
+17 −1 aidial_sdk/chat_completion/base.py
+3 −3 aidial_sdk/chat_completion/chunks.py
+13 −20 aidial_sdk/chat_completion/request.py
+14 −3 aidial_sdk/chat_completion/response.py
+0 −0 aidial_sdk/deployment/__init__.py
+74 −0 aidial_sdk/deployment/from_request_mixin.py
+7 −0 aidial_sdk/deployment/rate.py
+39 −0 aidial_sdk/deployment/tokenize.py
+26 −0 aidial_sdk/deployment/truncate_prompt.py
+13 −7 aidial_sdk/exceptions.py
+7 −8 aidial_sdk/header_propagator.py
+44 −11 aidial_sdk/telemetry/init.py
+38 −6 aidial_sdk/telemetry/types.py
+9 −0 aidial_sdk/utils/env.py
+11 −6 aidial_sdk/utils/errors.py
+6 −0 aidial_sdk/utils/pydantic.py
+2 −2 examples/image_size/requirements.txt
+2 −2 examples/render_text/requirements.txt
+108 −108 poetry.lock
+3 −3 pyproject.toml
+2 −0 tests/applications/broken_application.py
+47 −0 tests/applications/echo_application.py
+9 −0 tests/applications/noop_application.py
+12 −7 tests/test_discarded_messages.py
+36 −4 tests/test_errors.py
+19 −15 tests/test_rate_response.py
+65 −0 tests/test_tokenize.py
+108 −0 tests/test_truncate_prompt.py
+57 −0 tests/utils/endpoint_test.py
+47 −0 tests/utils/errors.py
+136 −0 tests/utils/tokenization.py

0 comments on commit da06e08

Please sign in to comment.