-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support native model ability to invoke tools (#50)
* Support native tools
- Loading branch information
1 parent
2f22c9d
commit 09923ec
Showing
35 changed files
with
1,229 additions
and
682 deletions.
There are no files selected for viewing
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,5 @@ | ||
CONFIG_DIR=aidial_assistant/configs | ||
LOG_LEVEL=DEBUG | ||
OPENAI_API_BASE=http://localhost:5001 | ||
WEB_CONCURRENCY=1 | ||
WEB_CONCURRENCY=1 | ||
TOOLS_SUPPORTING_DEPLOYMENTS=gpt-4-1106-preview |
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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
import logging.config | ||
import os | ||
from pathlib import Path | ||
|
||
from aidial_sdk import DIALApp | ||
from aidial_sdk.telemetry.types import TelemetryConfig, TracingConfig | ||
from starlette.responses import Response | ||
|
||
from aidial_assistant.application.assistant_application import ( | ||
AssistantApplication, | ||
) | ||
from aidial_assistant.utils.log_config import get_log_config | ||
|
||
log_level = os.getenv("LOG_LEVEL", "INFO") | ||
config_dir = Path(os.getenv("CONFIG_DIR", "aidial_assistant/configs")) | ||
|
||
logging.config.dictConfig(get_log_config(log_level)) | ||
|
||
telemetry_config = TelemetryConfig( | ||
service_name="aidial-assistant", tracing=TracingConfig() | ||
) | ||
app = DIALApp(telemetry_config=telemetry_config) | ||
app.add_chat_completion("assistant", AssistantApplication(config_dir)) | ||
|
||
# A delayed import is necessary to set up the httpx hook before the openai client inherits from AsyncClient. | ||
from aidial_assistant.application.assistant_application import ( # noqa: E402 | ||
AssistantApplication, | ||
) | ||
|
||
@app.get("/healthcheck/status200") | ||
def status200() -> Response: | ||
return Response("Service is running...", status_code=200) | ||
config_dir = Path(os.getenv("CONFIG_DIR", "aidial_assistant/configs")) | ||
tools_supporting_deployments: set[str] = set( | ||
os.getenv("TOOLS_SUPPORTING_DEPLOYMENTS", "").split(",") | ||
) | ||
app.add_chat_completion( | ||
"assistant", | ||
AssistantApplication(config_dir, tools_supporting_deployments), | ||
) |
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
Oops, something went wrong.