File tree Expand file tree Collapse file tree 10 files changed +216
-142
lines changed Expand file tree Collapse file tree 10 files changed +216
-142
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import {
44
44
} from "@/db/dexie/helpers"
45
45
import { UploadedFile } from "@/db/dexie/types"
46
46
import { isDatabaseClosedError } from "@/utils/ff-error"
47
+ import { updatePageTitle } from "@/utils/update-page-title"
47
48
48
49
type Props = {
49
50
onClose : ( ) => void
@@ -203,6 +204,7 @@ export const Sidebar = ({
203
204
} )
204
205
if ( historyId === history_id ) {
205
206
clearChat ( )
207
+ updatePageTitle ( )
206
208
}
207
209
}
208
210
} )
@@ -407,6 +409,7 @@ export const Sidebar = ({
407
409
const session = await getSessionFiles ( chat . id )
408
410
setContext ( session )
409
411
}
412
+ updatePageTitle ( chat . title )
410
413
navigate ( "/" )
411
414
onClose ( )
412
415
} } >
Original file line number Diff line number Diff line change @@ -487,6 +487,30 @@ export const dynamicFetchOllama2 = async ({
487
487
providerId : string
488
488
customHeaders ?: { key : string ; value : string } [ ]
489
489
} ) => {
490
+ if ( baseUrl . includes ( "ollama.com" ) ) {
491
+ // ollama.com is turbo pro something it only have 2 models
492
+ // we are currenly hardcoding it i don't why
493
+ const models = [
494
+ {
495
+ name : "gpt-oss:20b" ,
496
+ id : "gpt-oss:20b"
497
+ } ,
498
+ {
499
+ name : "gpt-oss:120b" ,
500
+ id : "gpt-oss:120b"
501
+ }
502
+ ]
503
+
504
+ return models . map ( ( e ) => {
505
+ return {
506
+ name : e ?. name || e ?. id ,
507
+ id : `${ e ?. id } _ollama2_${ providerId } ` ,
508
+ provider : providerId ,
509
+ lookup : `${ e ?. id } _${ providerId } ` ,
510
+ provider_id : providerId
511
+ }
512
+ } )
513
+ }
490
514
const models = await getAllOpenAIModels ( { baseUrl, customHeaders } )
491
515
const ollama2Models = models . map ( ( e ) => {
492
516
return {
Original file line number Diff line number Diff line change @@ -447,6 +447,8 @@ export const dynamicFetchOllama2 = async ({
447
447
providerId : string
448
448
customHeaders ?: { key : string ; value : string } [ ]
449
449
} ) => {
450
+
451
+
450
452
const models = await getAllOpenAIModels ( { baseUrl, customHeaders } )
451
453
const ollama2Models = models . map ( ( e ) => {
452
454
return {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
import { ChatDocuments } from "@/models/ChatTypes"
11
11
import { generateTitle } from "@/services/title"
12
12
import { ChatHistory } from "@/store/option"
13
+ import { updatePageTitle } from "@/utils/update-page-title"
13
14
14
15
export const saveMessageOnError = async ( {
15
16
e,
@@ -107,6 +108,7 @@ export const saveMessageOnError = async ({
107
108
} else {
108
109
const title = await generateTitle ( selectedModel , userMessage , userMessage )
109
110
const newHistoryId = await saveHistory ( title , false , message_source )
111
+ updatePageTitle ( title )
110
112
if ( ! isRegenerating ) {
111
113
await saveMessage ( {
112
114
history_id : newHistoryId . id ,
@@ -242,6 +244,7 @@ export const saveMessageOnSuccess = async ({
242
244
return historyId
243
245
} else {
244
246
const title = await generateTitle ( selectedModel , message , message )
247
+ updatePageTitle ( title )
245
248
const newHistoryId = await saveHistory ( title , false , message_source )
246
249
247
250
await saveMessage (
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import {
46
46
createSaveMessageOnError ,
47
47
createSaveMessageOnSuccess
48
48
} from "./utils/messageHelpers"
49
+ import { updatePageTitle } from "@/utils/update-page-title"
49
50
50
51
export const useMessage = ( ) => {
51
52
const {
@@ -124,6 +125,7 @@ export const useMessage = () => {
124
125
setIsLoading ( false )
125
126
setIsProcessing ( false )
126
127
setStreaming ( false )
128
+ updatePageTitle ( )
127
129
currentChatModelSettings . reset ( )
128
130
if ( defaultInternetSearchOn ) {
129
131
setWebSearch ( true )
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import { tabChatMode } from "./chat-modes/tabChatMode"
30
30
import { documentChatMode } from "./chat-modes/documentChatMode"
31
31
import { generateID } from "@/db/dexie/helpers"
32
32
import { UploadedFile } from "@/db/dexie/types"
33
+ import { updatePageTitle } from "@/utils/update-page-title"
33
34
34
35
export const useMessageOption = ( ) => {
35
36
const {
@@ -163,7 +164,7 @@ export const useMessageOption = () => {
163
164
setIsProcessing ( false )
164
165
setStreaming ( false )
165
166
setContextFiles ( [ ] )
166
- console . log ( "clearChat" , contextFiles )
167
+ updatePageTitle ( )
167
168
currentChatModelSettings . reset ( )
168
169
// textareaRef?.current?.focus()
169
170
if ( defaultInternetSearchOn ) {
You can’t perform that action at this time.
0 commit comments