Skip to content

Commit

Permalink
Merge pull request #10 from epam/fixes-from-development
Browse files Browse the repository at this point in the history
feat: fixes from development
  • Loading branch information
Oleksii-Klimov committed Oct 19, 2023
2 parents cc1a4dd + 7ba8e70 commit cba2646
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_check_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
run_tests:
uses: epam/ai-dial-ci/.github/workflows/test_python_docker.yml@0.1.0
uses: epam/ai-dial-ci/.github/workflows/test_python_docker.yml@0.3.0
with:
bypass_checks: false
python_version: 3.11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ env:

jobs:
release:
uses: epam/ai-dial-ci/.github/workflows/publish_python_docker.yml@0.1.0
uses: epam/ai-dial-ci/.github/workflows/publish_python_docker.yml@0.3.0
secrets: inherit
3 changes: 3 additions & 0 deletions aidial_assistant/application/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import logging

logger = logging.getLogger(__name__)
15 changes: 13 additions & 2 deletions aidial_assistant/application/assistant_application.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from pathlib import Path

from aidial_sdk import HTTPException
from aidial_sdk.chat_completion.base import ChatCompletion
from aidial_sdk.chat_completion.request import Addon, Request
from aidial_sdk.chat_completion.response import Response
from aiohttp import hdrs
from openai import InvalidRequestError
from openai import InvalidRequestError, OpenAIError

from aidial_assistant.application import logger
from aidial_assistant.application.args import parse_args
from aidial_assistant.application.prompts import (
MAIN_SYSTEM_DIALOG_MESSAGE,
Expand Down Expand Up @@ -112,7 +114,16 @@ async def chat_completion(
)
with response.create_single_choice() as choice:
callback = ServerChainCallback(choice)
await chain.run_chat(history, callback, usage_publisher)
try:
await chain.run_chat(history, callback, usage_publisher)
except OpenAIError as e:
logger.exception("Request processing has failed.")
raise HTTPException(
str(e),
status_code=e.http_status or 500,
code=e.code,
)

choice.set_state(callback.state)

response.set_usage(
Expand Down
21 changes: 0 additions & 21 deletions aidial_assistant/json_stream/parsing_context.py

This file was deleted.

31 changes: 19 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aidial-assistant"
version = "0.1.0rc"
version = "0.1.0"
description = "DIAL Assistant Service"
authors = ["EPAM RAIL <[email protected]>"]
homepage = "https://epam-rail.com"
Expand All @@ -19,7 +19,7 @@ clean = "scripts.clean:main"
python = "^3.11"
aiocache = "^0.12.2"
jinja2 = "^3.1.2"
langchain = "^0.0.309"
langchain = "^0.0.312"
openai = "^0.28.0"
pydantic = "1.10.13"
pyyaml = "^6.0.1"
Expand Down

0 comments on commit cba2646

Please sign in to comment.