fix: can't read the setting at first time (#2677)
Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
This commit is contained in:
parent
b19234ed71
commit
ddb73d8131
@ -102,6 +102,8 @@ export abstract class OAIEngine extends AIEngine {
|
||||
events.emit(MessageEvent.OnMessageUpdate, message)
|
||||
},
|
||||
error: async (err: any) => {
|
||||
console.debug('inference url: ', this.inferenceUrl)
|
||||
console.debug('header: ', header)
|
||||
console.error(`Inference error:`, JSON.stringify(err))
|
||||
if (this.isCancelled || message.content.length) {
|
||||
message.status = MessageStatus.Stopped
|
||||
|
||||
@ -37,6 +37,14 @@ export default class JanInferenceGroqExtension extends RemoteOAIEngine {
|
||||
Settings.chatCompletionsEndPoint,
|
||||
''
|
||||
)
|
||||
|
||||
if (this.inferenceUrl.length === 0) {
|
||||
SETTINGS.forEach((setting) => {
|
||||
if (setting.key === Settings.chatCompletionsEndPoint) {
|
||||
this.inferenceUrl = setting.controllerProps.value as string
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSettingUpdate<T>(key: string, value: T): void {
|
||||
|
||||
@ -36,6 +36,14 @@ export default class JanInferenceMistralExtension extends RemoteOAIEngine {
|
||||
Settings.chatCompletionsEndPoint,
|
||||
''
|
||||
)
|
||||
|
||||
if (this.inferenceUrl.length === 0) {
|
||||
SETTINGS.forEach((setting) => {
|
||||
if (setting.key === Settings.chatCompletionsEndPoint) {
|
||||
this.inferenceUrl = setting.controllerProps.value as string
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSettingUpdate<T>(key: string, value: T): void {
|
||||
|
||||
@ -37,6 +37,13 @@ export default class JanInferenceOpenAIExtension extends RemoteOAIEngine {
|
||||
Settings.chatCompletionsEndPoint,
|
||||
''
|
||||
)
|
||||
if (this.inferenceUrl.length === 0) {
|
||||
SETTINGS.forEach((setting) => {
|
||||
if (setting.key === Settings.chatCompletionsEndPoint) {
|
||||
this.inferenceUrl = setting.controllerProps.value as string
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSettingUpdate<T>(key: string, value: T): void {
|
||||
|
||||
@ -37,6 +37,14 @@ export default class JanInferenceTritonTrtLLMExtension extends RemoteOAIEngine {
|
||||
Settings.chatCompletionsEndPoint,
|
||||
''
|
||||
)
|
||||
|
||||
if (this.inferenceUrl.length === 0) {
|
||||
SETTINGS.forEach((setting) => {
|
||||
if (setting.key === Settings.chatCompletionsEndPoint) {
|
||||
this.inferenceUrl = setting.controllerProps.value as string
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSettingUpdate<T>(key: string, value: T): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user