Skip to content

Commit cba2646

Browse files
Merge pull request #10 from epam/fixes-from-development
feat: fixes from development
2 parents cc1a4dd + 7ba8e70 commit cba2646

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

.github/workflows/pr_check_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
run_tests:
11-
uses: epam/ai-dial-ci/.github/workflows/test_python_docker.yml@0.1.0
11+
uses: epam/ai-dial-ci/.github/workflows/test_python_docker.yml@0.3.0
1212
with:
1313
bypass_checks: false
1414
python_version: 3.11

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ env:
99

1010
jobs:
1111
release:
12-
uses: epam/ai-dial-ci/.github/workflows/publish_python_docker.yml@0.1.0
12+
uses: epam/ai-dial-ci/.github/workflows/publish_python_docker.yml@0.3.0
1313
secrets: inherit
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import logging
2+
3+
logger = logging.getLogger(__name__)

aidial_assistant/application/assistant_application.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from pathlib import Path
22

3+
from aidial_sdk import HTTPException
34
from aidial_sdk.chat_completion.base import ChatCompletion
45
from aidial_sdk.chat_completion.request import Addon, Request
56
from aidial_sdk.chat_completion.response import Response
67
from aiohttp import hdrs
7-
from openai import InvalidRequestError
8+
from openai import InvalidRequestError, OpenAIError
89

10+
from aidial_assistant.application import logger
911
from aidial_assistant.application.args import parse_args
1012
from aidial_assistant.application.prompts import (
1113
MAIN_SYSTEM_DIALOG_MESSAGE,
@@ -112,7 +114,16 @@ async def chat_completion(
112114
)
113115
with response.create_single_choice() as choice:
114116
callback = ServerChainCallback(choice)
115-
await chain.run_chat(history, callback, usage_publisher)
117+
try:
118+
await chain.run_chat(history, callback, usage_publisher)
119+
except OpenAIError as e:
120+
logger.exception("Request processing has failed.")
121+
raise HTTPException(
122+
str(e),
123+
status_code=e.http_status or 500,
124+
code=e.code,
125+
)
126+
116127
choice.set_state(callback.state)
117128

118129
response.set_usage(

aidial_assistant/json_stream/parsing_context.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

poetry.lock

Lines changed: 19 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "aidial-assistant"
3-
version = "0.1.0rc"
3+
version = "0.1.0"
44
description = "DIAL Assistant Service"
55
authors = ["EPAM RAIL <SpecialEPM-DIALDevTeam@epam.com>"]
66
homepage = "https://epam-rail.com"
@@ -19,7 +19,7 @@ clean = "scripts.clean:main"
1919
python = "^3.11"
2020
aiocache = "^0.12.2"
2121
jinja2 = "^3.1.2"
22-
langchain = "^0.0.309"
22+
langchain = "^0.0.312"
2323
openai = "^0.28.0"
2424
pydantic = "1.10.13"
2525
pyyaml = "^6.0.1"

0 commit comments

Comments
 (0)