mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat(ollama): Enhance Ollama support by adding new models, updating API format handling, and integrating translation functionality.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { FORMATS } from "../../translator/formats.js";
|
||||
import { needsTranslation } from "../../translator/index.js";
|
||||
import { ollamaBodyToOpenAI } from "../../translator/response/ollama-to-openai.js";
|
||||
import { addBufferToUsage, filterUsageForFormat } from "../../utils/usageTracking.js";
|
||||
import { createErrorResult } from "../../utils/error.js";
|
||||
import { HTTP_STATUS } from "../../config/constants.js";
|
||||
@@ -111,6 +112,11 @@ export function translateNonStreamingResponse(responseBody, targetFormat, source
|
||||
return result;
|
||||
}
|
||||
|
||||
// Ollama
|
||||
if (targetFormat === FORMATS.OLLAMA) {
|
||||
return ollamaBodyToOpenAI(responseBody);
|
||||
}
|
||||
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user