mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Cleanup after AIX migration
This commit is contained in:
@@ -9,15 +9,14 @@ import { capitalizeFirstLetter } from '~/common/util/textUtils';
|
||||
import { fixupHost } from '~/common/util/urlUtils';
|
||||
|
||||
import { ListModelsResponse_schema } from '../llm.server.types';
|
||||
import { OpenAIHistorySchema, OpenAIModelSchema } from '../openai/openai.router';
|
||||
|
||||
import { OLLAMA_BASE_MODELS, OLLAMA_PREV_UPDATE } from './ollama.models';
|
||||
import { WireOllamaChatCompletionInput, wireOllamaListModelsSchema, wireOllamaModelInfoSchema } from './ollama.wiretypes';
|
||||
import { wireOllamaListModelsSchema, wireOllamaModelInfoSchema } from './ollama.wiretypes';
|
||||
|
||||
|
||||
// Default hosts
|
||||
const DEFAULT_OLLAMA_HOST = 'http://127.0.0.1:11434';
|
||||
export const OLLAMA_PATH_CHAT = '/api/chat';
|
||||
// export const OLLAMA_PATH_CHAT = '/api/chat';
|
||||
const OLLAMA_PATH_TAGS = '/api/tags';
|
||||
const OLLAMA_PATH_SHOW = '/api/show';
|
||||
|
||||
@@ -38,7 +37,7 @@ export function ollamaAccess(access: OllamaAccessSchema, apiPath: string): { hea
|
||||
}
|
||||
|
||||
|
||||
export const ollamaChatCompletionPayload = (model: OpenAIModelSchema, history: OpenAIHistorySchema, jsonOutput: boolean, stream: boolean): WireOllamaChatCompletionInput => ({
|
||||
/*export const ollamaChatCompletionPayload = (model: OpenAIModelSchema, history: OpenAIHistorySchema, jsonOutput: boolean, stream: boolean): WireOllamaChatCompletionInput => ({
|
||||
model: model.id,
|
||||
messages: history,
|
||||
options: {
|
||||
@@ -49,7 +48,7 @@ export const ollamaChatCompletionPayload = (model: OpenAIModelSchema, history: O
|
||||
// functions: ...
|
||||
// function_call: ...
|
||||
stream,
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
/* Unused: switched to the Chat endpoint (above). The implementation is left here for reference.
|
||||
|
||||
@@ -36,18 +36,18 @@ export const openAIAccessSchema = z.object({
|
||||
});
|
||||
export type OpenAIAccessSchema = z.infer<typeof openAIAccessSchema>;
|
||||
|
||||
export const openAIModelSchema = z.object({
|
||||
id: z.string(),
|
||||
temperature: z.number().min(0).max(2).optional(),
|
||||
maxTokens: z.number().min(1).optional(),
|
||||
});
|
||||
export type OpenAIModelSchema = z.infer<typeof openAIModelSchema>;
|
||||
// export const openAIModelSchema = z.object({
|
||||
// id: z.string(),
|
||||
// temperature: z.number().min(0).max(2).optional(),
|
||||
// maxTokens: z.number().min(1).optional(),
|
||||
// });
|
||||
// export type OpenAIModelSchema = z.infer<typeof openAIModelSchema>;
|
||||
|
||||
export const openAIHistorySchema = z.array(z.object({
|
||||
role: z.enum(['assistant', 'system', 'user'/*, 'function'*/]),
|
||||
content: z.string(),
|
||||
}));
|
||||
export type OpenAIHistorySchema = z.infer<typeof openAIHistorySchema>;
|
||||
// export const openAIHistorySchema = z.array(z.object({
|
||||
// role: z.enum(['assistant', 'system', 'user'/*, 'function'*/]),
|
||||
// content: z.string(),
|
||||
// }));
|
||||
// export type OpenAIHistorySchema = z.infer<typeof openAIHistorySchema>;
|
||||
|
||||
|
||||
// Router Input Schemas
|
||||
|
||||
Reference in New Issue
Block a user