Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jupyterhub-ai
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Bücker
jupyterhub-ai
Merge requests
!4
Dev
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Dev
jr662933/jupyterhub-ai:dev
into
dev
Overview
0
Commits
4
Pipelines
1
Changes
7
Merged
Julian Rasch
requested to merge
jr662933/jupyterhub-ai:dev
into
dev
11 months ago
Overview
0
Commits
4
Pipelines
1
Changes
7
Expand
include conditional MyApp proxy for dash
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
f7166c60
4 commits,
11 months ago
7 files
+
119
−
28
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
app/callbacks.py
+
11
−
3
Options
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