@friendliai/ai-provider 0.1.16 → 0.1.19
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/README.md +4 -4
- package/dist/index.d.mts +0 -12
- package/dist/index.d.ts +0 -12
- package/dist/index.js +128 -4121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -4115
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -21
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ To use the provider, you need to set the `FRIENDLI_TOKEN` environment variable w
|
|
|
20
20
|
export FRIENDLI_TOKEN="YOUR_FRIENDLI_TOKEN"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Check the [FriendliAI documentation](https://
|
|
23
|
+
Check the [FriendliAI documentation](https://friendli.ai/docs/guides/personal_access_tokens) for more information.
|
|
24
24
|
|
|
25
25
|
## Provider Instance
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ import { friendli } from "@friendliai/ai-provider";
|
|
|
30
30
|
|
|
31
31
|
## Language Models
|
|
32
32
|
|
|
33
|
-
You can create [FriendliAI models](https://
|
|
33
|
+
You can create [FriendliAI models](https://friendli.ai/docs/guides/serverless_endpoints/text_generation#model-supports) using a provider instance.
|
|
34
34
|
The first argument is the model id, e.g. `meta-llama-3.1-8b-instruct`.
|
|
35
35
|
|
|
36
36
|
```ts
|
|
@@ -53,7 +53,7 @@ const { text } = await generateText({
|
|
|
53
53
|
|
|
54
54
|
### Example: Using built-in tools (Beta)
|
|
55
55
|
|
|
56
|
-
If you use `@friendliai/ai-provider`, you can use the [built-in tools](https://
|
|
56
|
+
If you use `@friendliai/ai-provider`, you can use the [built-in tools](https://friendli.ai/docs/guides/serverless_endpoints/tools/built_in_tools) via the `tools` option.
|
|
57
57
|
|
|
58
58
|
Built-in tools allow models to use tools to generate better answers. For example, a `web:search` tool can provide up-to-date answers to current questions.
|
|
59
59
|
|
|
@@ -90,7 +90,7 @@ FriendliAI language models can also be used in the `streamText`, `generateObject
|
|
|
90
90
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
91
91
|
|
|
92
92
|
const friendli = createOpenAI({
|
|
93
|
-
baseURL: "https://
|
|
93
|
+
baseURL: "https://api.friendli.ai/serverless/v1",
|
|
94
94
|
apiKey: process.env.FRIENDLI_TOKEN,
|
|
95
95
|
});
|
|
96
96
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -50,18 +50,6 @@ interface FriendliAIChatSettings {
|
|
|
50
50
|
files: Array<string>;
|
|
51
51
|
}>;
|
|
52
52
|
/**
|
|
53
|
-
Whether to use legacy function calling. Defaults to false.
|
|
54
|
-
|
|
55
|
-
Required by some open source inference engines which do not support the `tools` API. May also
|
|
56
|
-
provide a workaround for `parallelToolCalls` resulting in the provider buffering tool calls,
|
|
57
|
-
which causes `streamObject` to be non-streaming.
|
|
58
|
-
|
|
59
|
-
Prefer setting `parallelToolCalls: false` over this option.
|
|
60
|
-
|
|
61
|
-
@deprecated this API is supported but deprecated by FriendliAI.
|
|
62
|
-
*/
|
|
63
|
-
useLegacyFunctionCalling?: boolean;
|
|
64
|
-
/**
|
|
65
53
|
A unique identifier representing your end-user, which can help FriendliAI to
|
|
66
54
|
monitor and detect abuse. Learn more.
|
|
67
55
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -50,18 +50,6 @@ interface FriendliAIChatSettings {
|
|
|
50
50
|
files: Array<string>;
|
|
51
51
|
}>;
|
|
52
52
|
/**
|
|
53
|
-
Whether to use legacy function calling. Defaults to false.
|
|
54
|
-
|
|
55
|
-
Required by some open source inference engines which do not support the `tools` API. May also
|
|
56
|
-
provide a workaround for `parallelToolCalls` resulting in the provider buffering tool calls,
|
|
57
|
-
which causes `streamObject` to be non-streaming.
|
|
58
|
-
|
|
59
|
-
Prefer setting `parallelToolCalls: false` over this option.
|
|
60
|
-
|
|
61
|
-
@deprecated this API is supported but deprecated by FriendliAI.
|
|
62
|
-
*/
|
|
63
|
-
useLegacyFunctionCalling?: boolean;
|
|
64
|
-
/**
|
|
65
53
|
A unique identifier representing your end-user, which can help FriendliAI to
|
|
66
54
|
monitor and detect abuse. Learn more.
|
|
67
55
|
*/
|