Skip to content

Commit

Permalink
updated openwebui api provider options and fix fim
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmacarthy committed Apr 26, 2024
1 parent 4682248 commit 60ee0fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ export interface UiTabs {
}

export const ApiProviders = {
Ollama: 'ollama',
OllamaWebUi: 'ollamawebui',
LiteLLM: 'litellm',
LlamaCpp: 'llamacpp',
LMStudio: 'lmstudio',
Ollama: 'ollama',
Oobabooga: 'oobabooga',
LiteLLM: 'litellm'
OpenWebUI: 'openwebui',
} as const

export interface ApiModel {
Expand Down
4 changes: 2 additions & 2 deletions src/extension/provider-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function createStreamRequestBody(
): StreamBodyBase | StreamOptionsOllama | StreamBodyOpenAI {
switch (provider) {
case ApiProviders.Ollama:
case ApiProviders.OllamaWebUi:
case ApiProviders.OpenWebUI:
return {
model: options.model,
prompt,
Expand Down Expand Up @@ -63,7 +63,7 @@ export function createStreamRequestBodyFim(
): StreamBodyBase | StreamOptionsOllama | StreamBodyOpenAI {
switch (provider) {
case ApiProviders.Ollama:
case ApiProviders.OllamaWebUi:
case ApiProviders.OpenWebUI:
return {
model: options.model,
prompt,
Expand Down
3 changes: 2 additions & 1 deletion src/extension/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export const getChatDataFromProvider = (
) => {
switch (provider) {
case ApiProviders.Ollama:
case ApiProviders.OllamaWebUi:
case ApiProviders.OpenWebUI:
return data?.choices[0].delta?.content
? data?.choices[0].delta.content
: ''
Expand All @@ -326,6 +326,7 @@ export const getFimDataFromProvider = (
) => {
switch (provider) {
case ApiProviders.Ollama:
case ApiProviders.OpenWebUI:
return data?.response
case ApiProviders.LlamaCpp:
return data?.content
Expand Down

0 comments on commit 60ee0fd

Please sign in to comment.