|
21 | 21 | from app import settings |
22 | 22 | from app.const import MISSING, ToolChoice |
23 | 23 | 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 |
25 | 25 | from app.stackademy import stackademy_app |
26 | 26 | from app.utils import dump_json_colored |
27 | 27 |
|
|
50 | 50 | You should respond in a concise and clear manner, providing accurate information based on the user's request. |
51 | 51 | If you ask a follow up question, then place it at the bottom of the response and precede it with "QUESTION:". |
52 | 52 | """, |
53 | | - name=ASSISTANT_NAME, |
| 53 | + name=LLM_ASSISTANT_NAME, |
54 | 54 | ), |
55 | 55 | ChatCompletionAssistantMessageParam( |
56 | 56 | role="assistant", |
57 | 57 | content="How can I assist you with Stackademy today?", |
58 | | - name=ASSISTANT_NAME, |
| 58 | + name=LLM_ASSISTANT_NAME, |
59 | 59 | ), |
60 | 60 | ] |
61 | 61 |
|
@@ -111,7 +111,7 @@ def process_tool_calls(message: ChatCompletionMessage) -> list[str]: |
111 | 111 | assistant_content = message.content if message.content else "Accessing tool..." |
112 | 112 | messages.append( |
113 | 113 | 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 |
115 | 115 | ) |
116 | 116 | ) |
117 | 117 | logger.info("Function call detected: %s with args %s", function_name, function_args) |
@@ -183,7 +183,7 @@ def handle_completion(tools, tool_choice) -> ChatCompletion: |
183 | 183 |
|
184 | 184 | response = handle_completion( |
185 | 185 | # tool_choice={"type": "function", "function": {"name": "get_courses"}}, |
186 | | - tool_choice=TOOL_CHOICE, |
| 186 | + tool_choice=LLM_TOOL_CHOICE, |
187 | 187 | tools=[stackademy_app.tool_factory_get_courses()], |
188 | 188 | ) |
189 | 189 | logger.debug("Initial response: %s", dump_json_colored(response.model_dump(), "green")) |
|
0 commit comments