Skip to content

Commit

Permalink
add back gpt4turbo with the new option #223
Browse files Browse the repository at this point in the history
  • Loading branch information
juzeon committed Feb 20, 2024
1 parent ebdf9ea commit 2fb17fa
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ config.lock
debug_options_sets.json
dump.txt
config.json.old
_debug_options_sets.json
1 change: 1 addition & 0 deletions app_chatbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (a *App) createSydney() (*sydney.Sydney, error) {
CreateConversationURL: a.settings.config.CreateConversationURL,
NoSearch: currentWorkspace.NoSearch,
UseClassic: currentWorkspace.UseClassic,
GPT4Turbo: currentWorkspace.GPT4Turbo,
BypassServer: a.settings.config.BypassServer,
}), nil
}
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Workspace struct {
ImagePacks []sydney.GenerateImageResult `json:"image_packs"`
CreatedAt time.Time `json:"created_at"`
UseClassic bool `json:"use_classic"`
GPT4Turbo bool `json:"gpt_4_turbo"`
PersistentInput bool `json:"persistent_input"`
}
type OpenAIBackend struct {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/index/WorkspaceNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function addWorkspace() {
preset: props.currentWorkspace.preset,
image_packs: <GenerateImageResult[]>[],
use_classic: props.currentWorkspace.use_classic,
gpt_4_turbo: props.currentWorkspace.gpt_4_turbo,
persistent_input: props.currentWorkspace.persistent_input,
}
props.workspaces.push(workspace)
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ let currentWorkspace = ref(<Workspace>{
image_packs: <GenerateImageResult[]>[],
created_at: dayjs().format(),
use_classic: false,
gpt_4_turbo: false,
persistent_input: false,
})
Expand Down Expand Up @@ -412,6 +413,17 @@ function generateTitle() {
label="Preset"
density="compact"
class="mx-2"></v-select>
<v-tooltip
text="Enable the latest gpt-4-turbo model will increase the speed of response,
reduce repeatability, but be harder to jailbreak."
location="bottom">
<template #activator="{props}">
<v-switch v-bind="props" v-model="currentWorkspace.gpt_4_turbo" label="GPT-4-Turbo"
density="compact"
:disabled="currentWorkspace.backend!=='Sydney'" class="mx-2"
color="primary"></v-switch>
</template>
</v-tooltip>
<v-tooltip :text="additionalOptionPreview" location="bottom">
<template #activator="{props}">
<v-btn @click="additionalOptionsDialog=true" v-bind="props" icon variant="text" color="primary">
Expand Down
2 changes: 2 additions & 0 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export namespace main {
// Go type: time
created_at: any;
use_classic: boolean;
gpt_4_turbo: boolean;
persistent_input: boolean;

static createFrom(source: any = {}) {
Expand All @@ -136,6 +137,7 @@ export namespace main {
this.image_packs = this.convertValues(source["image_packs"], sydney.GenerateImageResult);
this.created_at = this.convertValues(source["created_at"], null);
this.use_classic = source["use_classic"];
this.gpt_4_turbo = source["gpt_4_turbo"];
this.persistent_input = source["persistent_input"];
}

Expand Down
3 changes: 3 additions & 0 deletions sydney/sydney.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ func NewSydney(options Options) *Sydney {
if options.NoSearch {
optionsSet = append(optionsSet, "nosearchall")
}
if options.GPT4Turbo && !options.UseClassic {
optionsSet = append(optionsSet, "gpt4tmncnp")
}
if debugOptionSets := util.ReadDebugOptionSets(); len(debugOptionSets) != 0 {
optionsSet = debugOptionSets
}
Expand Down
1 change: 1 addition & 0 deletions sydney/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type Options struct {
CreateConversationURL string
NoSearch bool
UseClassic bool
GPT4Turbo bool
BypassServer string
}
type AskStreamOptions struct {
Expand Down
2 changes: 2 additions & 0 deletions webapi/webapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func main() {
Locale: request.Locale,
NoSearch: request.NoSearch,
UseClassic: !request.UseGPT4Turbo,
GPT4Turbo: request.UseGPT4Turbo,
})

// stream chat
Expand Down Expand Up @@ -253,6 +254,7 @@ func main() {
Locale: "en-US",
NoSearch: request.ToolChoice == nil,
UseClassic: false,
GPT4Turbo: true,
})

messageCh, err := sydneyAPI.AskStream(sydney.AskStreamOptions{
Expand Down

0 comments on commit 2fb17fa

Please sign in to comment.