@flightdev/ai 0.0.2 → 0.0.3
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/README.md +8 -8
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @flightdev/ai
|
|
2
2
|
|
|
3
3
|
AI utilities for Flight Framework. Integrate with OpenAI, Anthropic, and other LLM providers.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @flightdev/ai
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { createAI } from '@
|
|
15
|
-
import { openai } from '@
|
|
14
|
+
import { createAI } from '@flightdev/ai';
|
|
15
|
+
import { openai } from '@flightdev/ai/openai';
|
|
16
16
|
|
|
17
17
|
const ai = createAI(openai({
|
|
18
18
|
apiKey: process.env.OPENAI_API_KEY,
|
|
@@ -30,7 +30,7 @@ console.log(response.content);
|
|
|
30
30
|
### OpenAI
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
|
-
import { openai } from '@
|
|
33
|
+
import { openai } from '@flightdev/ai/openai';
|
|
34
34
|
|
|
35
35
|
const adapter = openai({
|
|
36
36
|
apiKey: process.env.OPENAI_API_KEY,
|
|
@@ -41,7 +41,7 @@ const adapter = openai({
|
|
|
41
41
|
### Anthropic
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
|
-
import { anthropic } from '@
|
|
44
|
+
import { anthropic } from '@flightdev/ai/anthropic';
|
|
45
45
|
|
|
46
46
|
const adapter = anthropic({
|
|
47
47
|
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
@@ -52,7 +52,7 @@ const adapter = anthropic({
|
|
|
52
52
|
### Google AI (Gemini)
|
|
53
53
|
|
|
54
54
|
```typescript
|
|
55
|
-
import { google } from '@
|
|
55
|
+
import { google } from '@flightdev/ai/google';
|
|
56
56
|
|
|
57
57
|
const adapter = google({
|
|
58
58
|
apiKey: process.env.GOOGLE_AI_API_KEY,
|
|
@@ -75,7 +75,7 @@ for await (const chunk of stream) {
|
|
|
75
75
|
## React Integration
|
|
76
76
|
|
|
77
77
|
```tsx
|
|
78
|
-
import { useChat } from '@
|
|
78
|
+
import { useChat } from '@flightdev/ai/react';
|
|
79
79
|
|
|
80
80
|
function ChatBox() {
|
|
81
81
|
const { messages, input, setInput, send, isLoading } = useChat();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightdev/ai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Agnostic AI/LLM integration for Flight Framework. Choose your provider: OpenAI, Anthropic, Ollama, or custom.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -52,6 +52,12 @@
|
|
|
52
52
|
"ollama"
|
|
53
53
|
],
|
|
54
54
|
"license": "MIT",
|
|
55
|
+
"homepage": "https://github.com/EliosLT/FlightDev",
|
|
56
|
+
"repository": {
|
|
57
|
+
"url": "https://github.com/EliosLT/FlightDev.git",
|
|
58
|
+
"directory": "packages/ai",
|
|
59
|
+
"type": "git"
|
|
60
|
+
},
|
|
55
61
|
"scripts": {
|
|
56
62
|
"build": "tsup",
|
|
57
63
|
"dev": "tsup --watch",
|