Skip to content
Snippets Groups Projects

Dev

Merged Julian Rasch requested to merge jr662933/jupyterhub-ai:dev into dev
7 files
+ 119
28
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 11
3
import os
from datetime import datetime
from dash import (
@@ -10,7 +11,7 @@ from dash.dependencies import (
State
)
from llm_utils.client import ChatGPT
from llm_utils.client import ChatGPT, get_openai_client
def format_chat_messages(chat_history):
@@ -24,8 +25,15 @@ def format_chat_messages(chat_history):
def register_callbacks(app: Dash):
chat_gpt = ChatGPT(model="gpt4")
model="gpt4"
client = get_openai_client(
model=model,
config_path=os.environ.get("CONFIG_PATH")
)
chat_gpt = ChatGPT(
client=client,
model="gpt4"
)
@app.callback(
[Output('chat-container', 'children'),
Loading