Cleanup after AIX migration

This commit is contained in:
Enrico Ros
2024-12-11 02:18:34 -08:00
parent f0df743f12
commit c0dca032e4
2 changed files with 15 additions and 16 deletions
@@ -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.
+11 -11
View File
@@ -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