Skip to content

Commit be6b74e

Browse files
committed
style: lint
1 parent 6ae7989 commit be6b74e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.env-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ MYSQL_USER=your-username
99
MYSQL_PASSWORD=your-password
1010
MYSQL_DATABASE=your-database-name
1111
MYSQL_CHARSET=utf8mb4
12-
TOOL_CHOICE=required
12+
LLM_TOOL_CHOICE=required

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ docker-push:
8181
docker push ${DOCKERHUB_USERNAME}/${REPO_NAME}:latest
8282

8383
docker-run:
84-
docker run -it -e OPENAI_API_KEY=${OPENAI_API_KEY} -e ENVIRONMENT=prod -e MYSQL_HOST=${MYSQL_HOST} -e MYSQL_PORT=${MYSQL_PORT} -e MYSQL_USER=${MYSQL_USER} -e MYSQL_PASSWORD=${MYSQL_PASSWORD} -e MYSQL_DATABASE=${MYSQL_DATABASE} -e MYSQL_CHARSET=${MYSQL_CHARSET} -e LOGGING_LEVEL=${LOGGING_LEVEL} -e TOOL_CHOICE=${TOOL_CHOICE} ${DOCKERHUB_USERNAME}/${REPO_NAME}:latest
84+
docker run -it -e OPENAI_API_KEY=${OPENAI_API_KEY} -e ENVIRONMENT=prod -e MYSQL_HOST=${MYSQL_HOST} -e MYSQL_PORT=${MYSQL_PORT} -e MYSQL_USER=${MYSQL_USER} -e MYSQL_PASSWORD=${MYSQL_PASSWORD} -e MYSQL_DATABASE=${MYSQL_DATABASE} -e MYSQL_CHARSET=${MYSQL_CHARSET} -e LOGGING_LEVEL=${LOGGING_LEVEL} -e LLM_TOOL_CHOICE=${LLM_TOOL_CHOICE} ${DOCKERHUB_USERNAME}/${REPO_NAME}:latest
8585

8686
docker-prune:
8787
@if [ "`docker ps -aq`" ]; then \

app/prompt.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from app import settings
2222
from app.const import MISSING, ToolChoice
2323
from app.logging_config import get_logger, setup_logging
24-
from app.settings import ASSISTANT_NAME, TOOL_CHOICE
24+
from app.settings import LLM_ASSISTANT_NAME, LLM_TOOL_CHOICE
2525
from app.stackademy import stackademy_app
2626
from app.utils import dump_json_colored
2727

@@ -50,12 +50,12 @@
5050
You should respond in a concise and clear manner, providing accurate information based on the user's request.
5151
If you ask a follow up question, then place it at the bottom of the response and precede it with "QUESTION:".
5252
""",
53-
name=ASSISTANT_NAME,
53+
name=LLM_ASSISTANT_NAME,
5454
),
5555
ChatCompletionAssistantMessageParam(
5656
role="assistant",
5757
content="How can I assist you with Stackademy today?",
58-
name=ASSISTANT_NAME,
58+
name=LLM_ASSISTANT_NAME,
5959
),
6060
]
6161

@@ -111,7 +111,7 @@ def process_tool_calls(message: ChatCompletionMessage) -> list[str]:
111111
assistant_content = message.content if message.content else "Accessing tool..."
112112
messages.append(
113113
ChatCompletionAssistantMessageParam(
114-
role="assistant", content=assistant_content, tool_calls=tool_calls_param, name=ASSISTANT_NAME
114+
role="assistant", content=assistant_content, tool_calls=tool_calls_param, name=LLM_ASSISTANT_NAME
115115
)
116116
)
117117
logger.info("Function call detected: %s with args %s", function_name, function_args)
@@ -183,7 +183,7 @@ def handle_completion(tools, tool_choice) -> ChatCompletion:
183183

184184
response = handle_completion(
185185
# tool_choice={"type": "function", "function": {"name": "get_courses"}},
186-
tool_choice=TOOL_CHOICE,
186+
tool_choice=LLM_TOOL_CHOICE,
187187
tools=[stackademy_app.tool_factory_get_courses()],
188188
)
189189
logger.debug("Initial response: %s", dump_json_colored(response.model_dump(), "green"))

app/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
# General settings
1717
LOGGING_LEVEL = int(os.getenv("LOGGING_LEVEL", str(logging.INFO)))
18-
TOOL_CHOICE = os.getenv("TOOL_CHOICE", ToolChoice.REQUIRED)
19-
ASSISTANT_NAME = "StackademyAssistant"
2018

2119

22-
# OpenAI API settings
20+
# LLM/OpenAI API settings
21+
LLM_TOOL_CHOICE = os.getenv("LLM_TOOL_CHOICE", ToolChoice.REQUIRED)
22+
LLM_ASSISTANT_NAME = "StackademyAssistant"
2323
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", SET_ME_PLEASE)
2424
OPENAI_API_MODEL = os.getenv("OPENAI_API_MODEL", "gpt-4o-mini")
2525
OPENAI_API_TEMPERATURE = float(os.getenv("OPENAI_API_TEMPERATURE", "0.0"))

0 commit comments

Comments
 (0)