@friendliai/ai-provider 0.1.19 → 0.1.20
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.
- package/CHANGELOG.md +13 -0
- package/dist/index.d.mts +10 -12
- package/dist/index.d.ts +10 -12
- package/dist/index.js +154 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +150 -183
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @friendliai/ai-provider
|
|
2
2
|
|
|
3
|
+
## 0.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7caa63e: ## Updated code to match ai sdk 4.0.10
|
|
8
|
+
|
|
9
|
+
- createFriendliAI -> createFriendli
|
|
10
|
+
- Dependency Update
|
|
11
|
+
- Updated tool call parsing logic
|
|
12
|
+
- Improved object creation logic
|
|
13
|
+
- Added regex output support
|
|
14
|
+
- delete "content_filter", "function_call" finish reason
|
|
15
|
+
|
|
3
16
|
## 0.1.19
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,10 @@ interface FriendliAIChatSettings {
|
|
|
50
50
|
files: Array<string>;
|
|
51
51
|
}>;
|
|
52
52
|
/**
|
|
53
|
+
BETA FEATURE: You can write a regular expression to force output that satisfies that regular expression.
|
|
54
|
+
*/
|
|
55
|
+
regex?: string;
|
|
56
|
+
/**
|
|
53
57
|
A unique identifier representing your end-user, which can help FriendliAI to
|
|
54
58
|
monitor and detect abuse. Learn more.
|
|
55
59
|
*/
|
|
@@ -72,10 +76,6 @@ interface FriendliAIProviderSettings {
|
|
|
72
76
|
*/
|
|
73
77
|
baseURL?: string;
|
|
74
78
|
/**
|
|
75
|
-
@deprecated Use `baseURL` instead.
|
|
76
|
-
*/
|
|
77
|
-
baseUrl?: string;
|
|
78
|
-
/**
|
|
79
79
|
API key for authenticating requests.
|
|
80
80
|
*/
|
|
81
81
|
apiKey?: string;
|
|
@@ -88,12 +88,6 @@ interface FriendliAIProviderSettings {
|
|
|
88
88
|
*/
|
|
89
89
|
headers?: Record<string, string>;
|
|
90
90
|
/**
|
|
91
|
-
FriendliAI compatibility mode. Should be set to `strict` when using the FriendliAI API,
|
|
92
|
-
and `compatible` when using 3rd party providers. In `compatible` mode, newer
|
|
93
|
-
information such as streamOptions are not being sent. Defaults to 'compatible'.
|
|
94
|
-
*/
|
|
95
|
-
compatibility?: "strict" | "compatible";
|
|
96
|
-
/**
|
|
97
91
|
Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
98
92
|
or to provide a custom fetch implementation for e.g. testing.
|
|
99
93
|
*/
|
|
@@ -102,11 +96,15 @@ interface FriendliAIProviderSettings {
|
|
|
102
96
|
/**
|
|
103
97
|
Create an FriendliAI provider instance.
|
|
104
98
|
*/
|
|
105
|
-
declare function
|
|
99
|
+
declare function createFriendli(options?: FriendliAIProviderSettings): FriendliAIProvider;
|
|
106
100
|
declare const friendli: FriendliAIProvider;
|
|
107
101
|
/**
|
|
108
102
|
* @deprecated Use `friendli` instead.
|
|
109
103
|
*/
|
|
110
104
|
declare const friendliai: FriendliAIProvider;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `createFriendli` instead.
|
|
107
|
+
*/
|
|
108
|
+
declare const createFriendliAI: typeof createFriendli;
|
|
111
109
|
|
|
112
|
-
export { type FriendliAIProvider, type FriendliAIProviderSettings, createFriendliAI, friendli, friendliai };
|
|
110
|
+
export { type FriendliAIProvider, type FriendliAIProviderSettings, createFriendli, createFriendliAI, friendli, friendliai };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ interface FriendliAIChatSettings {
|
|
|
50
50
|
files: Array<string>;
|
|
51
51
|
}>;
|
|
52
52
|
/**
|
|
53
|
+
BETA FEATURE: You can write a regular expression to force output that satisfies that regular expression.
|
|
54
|
+
*/
|
|
55
|
+
regex?: string;
|
|
56
|
+
/**
|
|
53
57
|
A unique identifier representing your end-user, which can help FriendliAI to
|
|
54
58
|
monitor and detect abuse. Learn more.
|
|
55
59
|
*/
|
|
@@ -72,10 +76,6 @@ interface FriendliAIProviderSettings {
|
|
|
72
76
|
*/
|
|
73
77
|
baseURL?: string;
|
|
74
78
|
/**
|
|
75
|
-
@deprecated Use `baseURL` instead.
|
|
76
|
-
*/
|
|
77
|
-
baseUrl?: string;
|
|
78
|
-
/**
|
|
79
79
|
API key for authenticating requests.
|
|
80
80
|
*/
|
|
81
81
|
apiKey?: string;
|
|
@@ -88,12 +88,6 @@ interface FriendliAIProviderSettings {
|
|
|
88
88
|
*/
|
|
89
89
|
headers?: Record<string, string>;
|
|
90
90
|
/**
|
|
91
|
-
FriendliAI compatibility mode. Should be set to `strict` when using the FriendliAI API,
|
|
92
|
-
and `compatible` when using 3rd party providers. In `compatible` mode, newer
|
|
93
|
-
information such as streamOptions are not being sent. Defaults to 'compatible'.
|
|
94
|
-
*/
|
|
95
|
-
compatibility?: "strict" | "compatible";
|
|
96
|
-
/**
|
|
97
91
|
Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
98
92
|
or to provide a custom fetch implementation for e.g. testing.
|
|
99
93
|
*/
|
|
@@ -102,11 +96,15 @@ interface FriendliAIProviderSettings {
|
|
|
102
96
|
/**
|
|
103
97
|
Create an FriendliAI provider instance.
|
|
104
98
|
*/
|
|
105
|
-
declare function
|
|
99
|
+
declare function createFriendli(options?: FriendliAIProviderSettings): FriendliAIProvider;
|
|
106
100
|
declare const friendli: FriendliAIProvider;
|
|
107
101
|
/**
|
|
108
102
|
* @deprecated Use `friendli` instead.
|
|
109
103
|
*/
|
|
110
104
|
declare const friendliai: FriendliAIProvider;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `createFriendli` instead.
|
|
107
|
+
*/
|
|
108
|
+
declare const createFriendliAI: typeof createFriendli;
|
|
111
109
|
|
|
112
|
-
export { type FriendliAIProvider, type FriendliAIProviderSettings, createFriendliAI, friendli, friendliai };
|
|
110
|
+
export { type FriendliAIProvider, type FriendliAIProviderSettings, createFriendli, createFriendliAI, friendli, friendliai };
|