llm-proxy 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,10 @@ declare function convertLlamaToOpenAIStreamToolCall(chunk: any): {
|
|
|
10
10
|
role: string;
|
|
11
11
|
content: null;
|
|
12
12
|
function_call: {
|
|
13
|
-
name:
|
|
13
|
+
name: string | undefined;
|
|
14
|
+
arguments: string | undefined;
|
|
15
|
+
} | {
|
|
16
|
+
name: null;
|
|
14
17
|
arguments: string;
|
|
15
18
|
};
|
|
16
19
|
refusal: null;
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
function convertLlamaToOpenAIStreamToolCall(chunk) {
|
|
5
5
|
// @ts-ignore: Ignore the any type in the msg
|
|
6
6
|
function parseFunctionCall(generation) {
|
|
7
|
-
const functionCallRegex = /<function>\s*\{\s*"function_name":\s*"([^"]+)",\s*"parameters":\s*(\{\s*\}
|
|
7
|
+
const functionCallRegex = /<function>\s*\{\s*"function_name":\s*"([^"]+)",\s*"parameters":\s*(\{.*?\})\s*\}/s;
|
|
8
8
|
const match = generation.match(functionCallRegex);
|
|
9
9
|
if (match) {
|
|
10
10
|
const functionCall = {
|
|
11
11
|
name: match[1],
|
|
12
|
-
arguments: match[2]
|
|
12
|
+
arguments: match[2],
|
|
13
13
|
};
|
|
14
14
|
return functionCall;
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertLlamaToOpenAIStreamToolCall.js","sourceRoot":"","sources":["../../../src/utils/outputFormatAdapterUtils/convertLlamaToOpenAIStreamToolCall.ts"],"names":[],"mappings":";;AAAA,6CAA6C;AAC7C,SAAS,kCAAkC,CAAC,KAAK;IAC/C,6CAA6C;IAC7C,SAAS,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"convertLlamaToOpenAIStreamToolCall.js","sourceRoot":"","sources":["../../../src/utils/out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
|
|
1
1
|
{
|
|
2
2
|
"name": "llm-proxy",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "An LLM Proxy that allows the user to interact with different language models from different providers using unified request and response formats.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|