mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-13 22:17:48 -04:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9a3566aaf | |||
| fc729c8a00 | |||
| 4999df18cc | |||
| 9a27b6d94a | |||
| 8c02684f0f | |||
| 9c63f3f94e | |||
| c515a324f6 |
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"@llamaindex/nextjs-edge-runtime-test": patch
|
||||
"@llamaindex/next-node-runtime-test": patch
|
||||
"@llamaindex/next-agent-test": patch
|
||||
"@llamaindex/autotool": patch
|
||||
"@llamaindex/server": patch
|
||||
"@llamaindex/doc": patch
|
||||
---
|
||||
|
||||
bump nextjs
|
||||
@@ -1,5 +1,20 @@
|
||||
# @llamaindex/doc
|
||||
|
||||
## 0.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9c63f3f: Add support for openai responses api
|
||||
- Updated dependencies [9c63f3f]
|
||||
- Updated dependencies [c515a32]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
- @llamaindex/workflow@1.0.2
|
||||
- llamaindex@0.9.15
|
||||
- @llamaindex/cloud@4.0.2
|
||||
- @llamaindex/node-parser@2.0.2
|
||||
- @llamaindex/readers@3.0.2
|
||||
|
||||
## 0.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/doc",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"postinstall": "fumadocs-mdx",
|
||||
@@ -46,7 +46,7 @@
|
||||
"hast-util-to-jsx-runtime": "^2.3.2",
|
||||
"llamaindex": "workspace:*",
|
||||
"lucide-react": "^0.460.0",
|
||||
"next": "^15.2.1",
|
||||
"next": "^15.2.3",
|
||||
"next-themes": "^0.4.3",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
|
||||
@@ -46,6 +46,156 @@ or
|
||||
Settings.llm = new OpenAI({ model: "gpt-3.5-turbo", temperature: 0, apiKey: <YOUR_API_KEY>, baseURL: "https://api.scaleway.ai/v1" });
|
||||
```
|
||||
|
||||
## Using OpenAI Responses API
|
||||
|
||||
The OpenAI Responses API provides enhanced functionality for handling complex interactions, including built-in tools, annotations, and streaming responses. Here's how to use it:
|
||||
|
||||
### Basic Setup
|
||||
|
||||
```ts
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o",
|
||||
temperature: 0.1,
|
||||
maxOutputTokens: 1000
|
||||
});
|
||||
```
|
||||
|
||||
### Message Content Types
|
||||
|
||||
The API supports different types of message content, including text and images:
|
||||
|
||||
```ts
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "input_text",
|
||||
text: "What's in this image?"
|
||||
},
|
||||
{
|
||||
type: "input_image",
|
||||
image_url: "https://example.com/image.jpg",
|
||||
detail: "auto" // Optional: can be "auto", "low", or "high"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
### Advanced Features
|
||||
|
||||
#### Built-in Tools
|
||||
|
||||
```ts
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o",
|
||||
builtInTools: [
|
||||
{
|
||||
type: "function",
|
||||
name: "search_files",
|
||||
description: "Search through available files"
|
||||
}
|
||||
],
|
||||
strict: true // Enable strict mode for tool calls
|
||||
});
|
||||
```
|
||||
|
||||
#### Response Tracking and Storage
|
||||
|
||||
```ts
|
||||
const llm = openaiResponses({
|
||||
trackPreviousResponses: true, // Enable response tracking
|
||||
store: true, // Store responses for future reference
|
||||
user: "user-123", // Associate responses with a user
|
||||
callMetadata: { // Add custom metadata
|
||||
sessionId: "session-123",
|
||||
context: "customer-support"
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### Streaming Responses
|
||||
|
||||
```ts
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "Generate a long response"
|
||||
}
|
||||
],
|
||||
stream: true // Enable streaming
|
||||
});
|
||||
|
||||
for await (const chunk of response) {
|
||||
console.log(chunk.delta); // Process each chunk of the response
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
The OpenAI Responses API supports various configuration options:
|
||||
|
||||
```ts
|
||||
const llm = openaiResponses({
|
||||
// Model and basic settings
|
||||
model: "gpt-4o",
|
||||
temperature: 0.1,
|
||||
topP: 1,
|
||||
maxOutputTokens: 1000,
|
||||
|
||||
// API configuration
|
||||
apiKey: "your-api-key",
|
||||
baseURL: "custom-endpoint",
|
||||
maxRetries: 10,
|
||||
timeout: 60000,
|
||||
|
||||
// Response handling
|
||||
trackPreviousResponses: false,
|
||||
store: false,
|
||||
strict: false,
|
||||
|
||||
// Additional options
|
||||
instructions: "Custom instructions for the model",
|
||||
truncation: "auto", // Can be "auto", "disabled", or null
|
||||
include: ["citations", "reasoning"] // Specify what to include in responses
|
||||
});
|
||||
```
|
||||
|
||||
### Response Structure
|
||||
|
||||
The API returns responses with rich metadata and optional annotations:
|
||||
|
||||
```ts
|
||||
interface ResponseStructure {
|
||||
message: {
|
||||
content: string;
|
||||
role: "assistant";
|
||||
options: {
|
||||
built_in_tool_calls: Array<ToolCall>;
|
||||
annotations?: Array<Citation | URLCitation | FilePath>;
|
||||
refusal?: string;
|
||||
reasoning?: ReasoningItem;
|
||||
usage?: ResponseUsage;
|
||||
toolCall?: Array<PartialToolCall>;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. Use `trackPreviousResponses` when you need conversation continuity
|
||||
2. Enable `strict` mode when using tools to ensure accurate function calls
|
||||
3. Set appropriate `maxOutputTokens` to control response length
|
||||
4. Use `annotations` to track citations and references in responses
|
||||
5. Implement error handling for potential API failures and retries
|
||||
|
||||
## Using JSON Response Format
|
||||
|
||||
You can configure OpenAI to return responses in JSON format:
|
||||
@@ -73,6 +223,112 @@ Settings.llm = new OpenAI({
|
||||
});
|
||||
```
|
||||
|
||||
## Response Formats
|
||||
|
||||
The OpenAI LLM supports different response formats to structure the output in specific ways. There are two main approaches to formatting responses:
|
||||
|
||||
### 1. JSON Object Format
|
||||
|
||||
The simplest way to get structured JSON responses is using the `json_object` response format:
|
||||
|
||||
```ts
|
||||
Settings.llm = new OpenAI({
|
||||
model: "gpt-4o",
|
||||
temperature: 0,
|
||||
responseFormat: { type: "json_object" }
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "system",
|
||||
content: "You are a helpful assistant that outputs JSON."
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: "Summarize this meeting transcript"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Response will be valid JSON
|
||||
console.log(response.message.content);
|
||||
```
|
||||
|
||||
### 2. Schema Validation with Zod
|
||||
|
||||
For more robust type safety and validation, you can use Zod schemas to define the expected response structure:
|
||||
|
||||
```ts
|
||||
import { z } from "zod";
|
||||
|
||||
// Define the response schema
|
||||
const meetingSchema = z.object({
|
||||
summary: z.string(),
|
||||
participants: z.array(z.string()),
|
||||
actionItems: z.array(z.string()),
|
||||
nextSteps: z.string()
|
||||
});
|
||||
|
||||
// Configure the LLM with the schema
|
||||
Settings.llm = new OpenAI({
|
||||
model: "gpt-4o",
|
||||
temperature: 0,
|
||||
responseFormat: meetingSchema
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "Summarize this meeting transcript"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Response will be typed and validated according to the schema
|
||||
const result = response.message.content;
|
||||
console.log(result.summary);
|
||||
console.log(result.actionItems);
|
||||
```
|
||||
|
||||
### Response Format Options
|
||||
|
||||
The response format can be configured in two ways:
|
||||
|
||||
1. At LLM initialization:
|
||||
```ts
|
||||
const llm = new OpenAI({
|
||||
model: "gpt-4o",
|
||||
responseFormat: { type: "json_object" } // or a Zod schema
|
||||
});
|
||||
```
|
||||
|
||||
2. Per request:
|
||||
```ts
|
||||
const response = await llm.chat({
|
||||
messages: [...],
|
||||
responseFormat: { type: "json_object" } // or a Zod schema
|
||||
});
|
||||
```
|
||||
|
||||
The response format options are:
|
||||
|
||||
- `{ type: "json_object" }` - Returns responses as JSON objects
|
||||
- `zodSchema` - A Zod schema that defines and validates the response structure
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. Use JSON object format for simple structured responses
|
||||
2. Use Zod schemas when you need:
|
||||
- Type safety
|
||||
- Response validation
|
||||
- Complex nested structures
|
||||
- Specific field constraints
|
||||
3. Set a low temperature (e.g. 0) when using structured outputs for more reliable formatting
|
||||
4. Include clear instructions in system or user messages about the expected response format
|
||||
5. Handle potential parsing errors when working with JSON responses
|
||||
|
||||
## Load and index documents
|
||||
|
||||
For this example, we will use a single document. In a real-world scenario, you would have multiple documents to index.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/* Specify what module code is generated. */
|
||||
"module": "es2022",
|
||||
/* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
"moduleResolution": "Bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
/* Specify type package names to be included without being referenced in a source file. */
|
||||
"types": ["@cloudflare/workers-types/2023-07-01"],
|
||||
/* Enable importing .json files */
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/cloudflare-worker-agent-test
|
||||
|
||||
## 0.0.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.0.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloudflare-worker-agent-test",
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.149",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/* Modules */
|
||||
"module": "es2022" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
||||
"moduleResolution": "nodenext" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/llama-parse-browser-test
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @llamaindex/cloud@4.0.2
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/llama-parse-browser-test",
|
||||
"private": true,
|
||||
"version": "0.0.56",
|
||||
"version": "0.0.57",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"module": "nodenext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"skipLibCheck": true,
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/next-agent-test
|
||||
|
||||
## 0.1.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.1.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-agent-test",
|
||||
"version": "0.1.148",
|
||||
"version": "0.1.149",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
@@ -10,7 +10,7 @@
|
||||
"dependencies": {
|
||||
"ai": "^4.0.0",
|
||||
"llamaindex": "workspace:*",
|
||||
"next": "15.2.0",
|
||||
"next": "^15.2.3",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0"
|
||||
},
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# test-edge-runtime
|
||||
|
||||
## 0.1.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.1.147
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/nextjs-edge-runtime-test",
|
||||
"version": "0.1.147",
|
||||
"version": "0.1.148",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"llamaindex": "workspace:*",
|
||||
"next": "15.2.0",
|
||||
"next": "^15.2.3",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/next-node-runtime
|
||||
|
||||
## 0.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
- @llamaindex/huggingface@0.1.2
|
||||
- @llamaindex/readers@3.0.2
|
||||
|
||||
## 0.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-node-runtime-test",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
@@ -11,7 +11,7 @@
|
||||
"@llamaindex/huggingface": "workspace:*",
|
||||
"@llamaindex/readers": "workspace:*",
|
||||
"llamaindex": "workspace:*",
|
||||
"next": "15.2.0",
|
||||
"next": "^15.2.3",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0"
|
||||
},
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# vite-import-llamaindex
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vite-import-llamaindex",
|
||||
"private": true,
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"module": "nodenext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/waku-query-engine-test
|
||||
|
||||
## 0.0.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.0.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/waku-query-engine-test",
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.149",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"target": "esnext",
|
||||
"downlevelIteration": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "ESNext",
|
||||
"types": ["node"]
|
||||
},
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
# examples
|
||||
|
||||
## 0.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9c63f3f: Add support for openai responses api
|
||||
- Updated dependencies [9c63f3f]
|
||||
- Updated dependencies [c515a32]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/google@0.2.2
|
||||
- @llamaindex/core@0.6.2
|
||||
- @llamaindex/workflow@1.0.2
|
||||
- llamaindex@0.9.15
|
||||
- @llamaindex/clip@0.0.48
|
||||
- @llamaindex/deepinfra@0.0.48
|
||||
- @llamaindex/deepseek@0.0.8
|
||||
- @llamaindex/fireworks@0.0.8
|
||||
- @llamaindex/groq@0.0.63
|
||||
- @llamaindex/huggingface@0.1.2
|
||||
- @llamaindex/jinaai@0.0.8
|
||||
- @llamaindex/perplexity@0.0.5
|
||||
- @llamaindex/azure@0.1.11
|
||||
- @llamaindex/elastic-search@0.1.2
|
||||
- @llamaindex/milvus@0.1.11
|
||||
- @llamaindex/qdrant@0.1.11
|
||||
- @llamaindex/supabase@0.1.1
|
||||
- @llamaindex/together@0.0.8
|
||||
- @llamaindex/vllm@0.0.34
|
||||
- @llamaindex/cloud@4.0.2
|
||||
- @llamaindex/node-parser@2.0.2
|
||||
- @llamaindex/anthropic@0.3.2
|
||||
- @llamaindex/cohere@0.0.16
|
||||
- @llamaindex/mistral@0.1.2
|
||||
- @llamaindex/mixedbread@0.0.16
|
||||
- @llamaindex/ollama@0.1.2
|
||||
- @llamaindex/portkey-ai@0.0.44
|
||||
- @llamaindex/replicate@0.0.44
|
||||
- @llamaindex/astra@0.0.16
|
||||
- @llamaindex/chroma@0.0.16
|
||||
- @llamaindex/firestore@1.0.9
|
||||
- @llamaindex/mongodb@0.0.16
|
||||
- @llamaindex/pinecone@0.1.2
|
||||
- @llamaindex/postgres@0.0.44
|
||||
- @llamaindex/upstash@0.0.16
|
||||
- @llamaindex/weaviate@0.0.16
|
||||
- @llamaindex/vercel@0.1.2
|
||||
- @llamaindex/voyage-ai@1.0.8
|
||||
- @llamaindex/readers@3.0.2
|
||||
- @llamaindex/tools@0.0.4
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
import { wiki } from "@llamaindex/tools";
|
||||
import { agent, tool } from "llamaindex";
|
||||
import { z } from "zod";
|
||||
|
||||
const workflow = agent({
|
||||
tools: [
|
||||
tool({
|
||||
name: "weather",
|
||||
description: "Get the weather",
|
||||
parameters: z.object({
|
||||
location: z.string().describe("The location to get the weather for"),
|
||||
}),
|
||||
execute: ({ location }) => `The weather in ${location} is sunny`,
|
||||
}),
|
||||
wiki(),
|
||||
],
|
||||
llm: openaiResponses({
|
||||
model: "gpt-4o-mini",
|
||||
}),
|
||||
});
|
||||
|
||||
async function main() {
|
||||
const result = await workflow.run(
|
||||
"What is the weather in New York? What's the history of New York from Wikipedia in 3 sentences?",
|
||||
);
|
||||
console.log(result.data);
|
||||
}
|
||||
|
||||
void main();
|
||||
@@ -0,0 +1,33 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o",
|
||||
maxOutputTokens: 1000,
|
||||
apiKey: process.env.MY_OPENAI_API_KEY,
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: "What's in this image? Describe it in detail.",
|
||||
},
|
||||
{
|
||||
type: "image_url",
|
||||
image_url: {
|
||||
url: "https://storage.googleapis.com/cloud-samples-data/vision/face/faces.jpeg",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
console.log("Single Image Analysis:", response.message.content);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,22 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o-mini",
|
||||
temperature: 0.1,
|
||||
});
|
||||
|
||||
// Basic chat example
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What is the capital of France?",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
console.log(response.message.content);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,26 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o-mini",
|
||||
temperature: 0.1,
|
||||
});
|
||||
|
||||
const stream = await llm.chat({
|
||||
messages: [
|
||||
{ content: "You want to talk in rhymes.", role: "system" },
|
||||
{
|
||||
content:
|
||||
"How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
|
||||
role: "user",
|
||||
},
|
||||
],
|
||||
stream: true,
|
||||
});
|
||||
|
||||
for await (const chunk of stream) {
|
||||
process.stdout.write(chunk.delta);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,37 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
import { tool } from "llamaindex";
|
||||
|
||||
import { z } from "zod";
|
||||
async function main() {
|
||||
const weatherTool = tool({
|
||||
name: "weather",
|
||||
description: "Get the weather",
|
||||
parameters: z.object({
|
||||
location: z.string({
|
||||
description: "The location to get the weather for",
|
||||
}),
|
||||
}),
|
||||
execute: ({ location }) => {
|
||||
return `The weather in ${location} is sunny`;
|
||||
},
|
||||
});
|
||||
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o-mini",
|
||||
temperature: 0.1,
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What is the weather in New York?",
|
||||
},
|
||||
],
|
||||
tools: [weatherTool],
|
||||
});
|
||||
|
||||
console.log(response.message.options);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,23 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4o",
|
||||
temperature: 0.1,
|
||||
builtInTools: [{ type: "web_search_preview" }],
|
||||
});
|
||||
|
||||
// Streaming chat example
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What are the latest developments in AI?",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
console.log(response.message.content);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
+42
-42
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/examples",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
@@ -11,47 +11,47 @@
|
||||
"@azure/cosmos": "^4.1.1",
|
||||
"@azure/identity": "^4.4.1",
|
||||
"@azure/search-documents": "^12.1.0",
|
||||
"@llamaindex/anthropic": "^0.3.1",
|
||||
"@llamaindex/astra": "^0.0.15",
|
||||
"@llamaindex/azure": "^0.1.10",
|
||||
"@llamaindex/chroma": "^0.0.15",
|
||||
"@llamaindex/clip": "^0.0.47",
|
||||
"@llamaindex/cloud": "^4.0.1",
|
||||
"@llamaindex/cohere": "^0.0.15",
|
||||
"@llamaindex/core": "^0.6.1",
|
||||
"@llamaindex/deepinfra": "^0.0.47",
|
||||
"@llamaindex/anthropic": "^0.3.2",
|
||||
"@llamaindex/astra": "^0.0.16",
|
||||
"@llamaindex/azure": "^0.1.11",
|
||||
"@llamaindex/chroma": "^0.0.16",
|
||||
"@llamaindex/clip": "^0.0.48",
|
||||
"@llamaindex/cloud": "^4.0.2",
|
||||
"@llamaindex/cohere": "^0.0.16",
|
||||
"@llamaindex/core": "^0.6.2",
|
||||
"@llamaindex/deepinfra": "^0.0.48",
|
||||
"@llamaindex/env": "^0.1.29",
|
||||
"@llamaindex/firestore": "^1.0.8",
|
||||
"@llamaindex/google": "^0.2.1",
|
||||
"@llamaindex/groq": "^0.0.62",
|
||||
"@llamaindex/huggingface": "^0.1.1",
|
||||
"@llamaindex/milvus": "^0.1.10",
|
||||
"@llamaindex/mistral": "^0.1.1",
|
||||
"@llamaindex/mixedbread": "^0.0.15",
|
||||
"@llamaindex/mongodb": "^0.0.15",
|
||||
"@llamaindex/elastic-search": "^0.1.1",
|
||||
"@llamaindex/node-parser": "^2.0.1",
|
||||
"@llamaindex/ollama": "^0.1.1",
|
||||
"@llamaindex/openai": "^0.2.1",
|
||||
"@llamaindex/pinecone": "^0.1.1",
|
||||
"@llamaindex/portkey-ai": "^0.0.43",
|
||||
"@llamaindex/postgres": "^0.0.43",
|
||||
"@llamaindex/qdrant": "^0.1.10",
|
||||
"@llamaindex/readers": "^3.0.1",
|
||||
"@llamaindex/replicate": "^0.0.43",
|
||||
"@llamaindex/upstash": "^0.0.15",
|
||||
"@llamaindex/vercel": "^0.1.1",
|
||||
"@llamaindex/vllm": "^0.0.33",
|
||||
"@llamaindex/voyage-ai": "^1.0.7",
|
||||
"@llamaindex/weaviate": "^0.0.15",
|
||||
"@llamaindex/workflow": "^1.0.1",
|
||||
"@llamaindex/deepseek": "^0.0.7",
|
||||
"@llamaindex/fireworks": "^0.0.7",
|
||||
"@llamaindex/together": "^0.0.7",
|
||||
"@llamaindex/jinaai": "^0.0.7",
|
||||
"@llamaindex/perplexity": "^0.0.4",
|
||||
"@llamaindex/supabase": "^0.1.0",
|
||||
"@llamaindex/tools": "^0.0.3",
|
||||
"@llamaindex/firestore": "^1.0.9",
|
||||
"@llamaindex/google": "^0.2.2",
|
||||
"@llamaindex/groq": "^0.0.63",
|
||||
"@llamaindex/huggingface": "^0.1.2",
|
||||
"@llamaindex/milvus": "^0.1.11",
|
||||
"@llamaindex/mistral": "^0.1.2",
|
||||
"@llamaindex/mixedbread": "^0.0.16",
|
||||
"@llamaindex/mongodb": "^0.0.16",
|
||||
"@llamaindex/elastic-search": "^0.1.2",
|
||||
"@llamaindex/node-parser": "^2.0.2",
|
||||
"@llamaindex/ollama": "^0.1.2",
|
||||
"@llamaindex/openai": "^0.3.0",
|
||||
"@llamaindex/pinecone": "^0.1.2",
|
||||
"@llamaindex/portkey-ai": "^0.0.44",
|
||||
"@llamaindex/postgres": "^0.0.44",
|
||||
"@llamaindex/qdrant": "^0.1.11",
|
||||
"@llamaindex/readers": "^3.0.2",
|
||||
"@llamaindex/replicate": "^0.0.44",
|
||||
"@llamaindex/upstash": "^0.0.16",
|
||||
"@llamaindex/vercel": "^0.1.2",
|
||||
"@llamaindex/vllm": "^0.0.34",
|
||||
"@llamaindex/voyage-ai": "^1.0.8",
|
||||
"@llamaindex/weaviate": "^0.0.16",
|
||||
"@llamaindex/workflow": "^1.0.2",
|
||||
"@llamaindex/deepseek": "^0.0.8",
|
||||
"@llamaindex/fireworks": "^0.0.8",
|
||||
"@llamaindex/together": "^0.0.8",
|
||||
"@llamaindex/jinaai": "^0.0.8",
|
||||
"@llamaindex/perplexity": "^0.0.5",
|
||||
"@llamaindex/supabase": "^0.1.1",
|
||||
"@llamaindex/tools": "^0.0.4",
|
||||
"@notionhq/client": "^2.2.15",
|
||||
"@pinecone-database/pinecone": "^4.0.0",
|
||||
"@vercel/postgres": "^0.10.0",
|
||||
@@ -60,7 +60,7 @@
|
||||
"commander": "^12.1.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"js-tiktoken": "^1.0.14",
|
||||
"llamaindex": "^0.9.14",
|
||||
"llamaindex": "^0.9.15",
|
||||
"mongodb": "6.7.0",
|
||||
"postgres": "^3.4.4",
|
||||
"wikipedia": "^2.1.2",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./dist",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@
|
||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||
"turbo": "^2.4.4",
|
||||
"typescript": "^5.7.3",
|
||||
"typescript-eslint": "^8.18.0"
|
||||
"typescript-eslint": "^8.18.0",
|
||||
"vitest": "^3.1.1"
|
||||
},
|
||||
"packageManager": "pnpm@9.12.3",
|
||||
"lint-staged": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/autotool
|
||||
|
||||
## 6.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 6.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/autotool-01-node-example
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
- @llamaindex/autotool@6.0.15
|
||||
|
||||
## 0.0.95
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"scripts": {
|
||||
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
|
||||
},
|
||||
"version": "0.0.95"
|
||||
"version": "0.0.96"
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16"
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext"
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"url": "git+https://github.com/run-llama/LlamaIndexTS.git",
|
||||
"directory": "packages/autotool"
|
||||
},
|
||||
"version": "6.0.14",
|
||||
"version": "6.0.15",
|
||||
"description": "auto transpile your JS function to LLM Agent compatible",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -77,7 +77,7 @@
|
||||
"@types/node": "^22.9.0",
|
||||
"bunchee": "6.4.0",
|
||||
"llamaindex": "workspace:*",
|
||||
"next": "15.2.0",
|
||||
"next": "^15.2.3",
|
||||
"rollup": "^4.28.1",
|
||||
"tsx": "^4.19.3",
|
||||
"typescript": "^5.7.3",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"types": ["node"]
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/cloud
|
||||
|
||||
## 4.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 4.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloud",
|
||||
"version": "4.0.1",
|
||||
"version": "4.0.2",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"types": []
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/community
|
||||
|
||||
## 0.0.94
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.0.93
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/community",
|
||||
"description": "Community package for LlamaIndexTS",
|
||||
"version": "0.0.93",
|
||||
"version": "0.0.94",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["./src"],
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/core
|
||||
|
||||
## 0.6.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9c63f3f: Add support for openai responses api
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/core",
|
||||
"type": "module",
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"description": "LlamaIndex Core Module",
|
||||
"exports": {
|
||||
"./agent": {
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Tokenizers } from "@llamaindex/env/tokenizers";
|
||||
import type { JSONSchemaType } from "ajv";
|
||||
import { z } from "zod";
|
||||
import type { JSONObject, JSONValue } from "../global";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -55,7 +54,12 @@ export interface LLM<
|
||||
): Promise<CompletionResponse>;
|
||||
}
|
||||
|
||||
export type MessageType = "user" | "assistant" | "system" | "memory";
|
||||
export type MessageType =
|
||||
| "user"
|
||||
| "assistant"
|
||||
| "system"
|
||||
| "memory"
|
||||
| "developer";
|
||||
|
||||
export type TextChatMessage<AdditionalMessageOptions extends object = object> =
|
||||
{
|
||||
@@ -156,6 +160,7 @@ export type MessageContentTextDetail = {
|
||||
export type MessageContentImageDetail = {
|
||||
type: "image_url";
|
||||
image_url: { url: string };
|
||||
detail?: "high" | "low" | "auto";
|
||||
};
|
||||
|
||||
export type MessageContentDetail =
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "ESNext"
|
||||
},
|
||||
"include": ["./**/*.ts"],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"types": ["node"]
|
||||
|
||||
Vendored
+2
-2
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "ESNext"
|
||||
},
|
||||
"include": ["./**/*.ts"],
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "node16",
|
||||
"moduleResolution": "nodenext",
|
||||
"types": ["node"],
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/experimental
|
||||
|
||||
## 0.0.165
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.9.15
|
||||
|
||||
## 0.0.164
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/experimental",
|
||||
"description": "Experimental package for LlamaIndexTS",
|
||||
"version": "0.0.164",
|
||||
"version": "0.0.165",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["./src"],
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.9.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- Updated dependencies [c515a32]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
- @llamaindex/workflow@1.0.2
|
||||
- @llamaindex/cloud@4.0.2
|
||||
- @llamaindex/node-parser@2.0.2
|
||||
|
||||
## 0.9.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "llamaindex",
|
||||
"version": "0.9.14",
|
||||
"version": "0.9.15",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"keywords": [
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "ESNext"
|
||||
},
|
||||
"include": ["./**/*.ts"],
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"strict": true
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/node-parser
|
||||
|
||||
## 2.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 2.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/node-parser",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"description": "Node parser for LlamaIndex",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"outDir": "./dist/type",
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"types": ["node"]
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/anthropic
|
||||
|
||||
## 0.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/anthropic",
|
||||
"description": "Anthropic Adapter for LlamaIndex",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/clip
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/clip",
|
||||
"description": "Clip Embedding Adapter for LlamaIndex",
|
||||
"version": "0.0.47",
|
||||
"version": "0.0.48",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/cohere
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/cohere",
|
||||
"description": "Cohere Adapter for LlamaIndex",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/deepinfra
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/deepinfra",
|
||||
"description": "Deepinfra Adapter for LlamaIndex",
|
||||
"version": "0.0.47",
|
||||
"version": "0.0.48",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/deepseek
|
||||
|
||||
## 0.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/deepseek",
|
||||
"description": "DeepSeek Adapter for LlamaIndex",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/fireworks
|
||||
|
||||
## 0.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/fireworks",
|
||||
"description": "Fireworks Adapter for LlamaIndex",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/google
|
||||
|
||||
## 0.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9c63f3f: Add support for openai responses api
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/google",
|
||||
"description": "Google Adapter for LlamaIndex",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -181,7 +181,7 @@ export const mapBaseToolToGeminiFunctionDeclaration = (
|
||||
export class GeminiHelper {
|
||||
// Gemini only has user and model roles. Put the rest in user role.
|
||||
public static readonly ROLES_TO_GEMINI: Record<
|
||||
MessageType,
|
||||
Exclude<MessageType, "developer">,
|
||||
GeminiMessageRole
|
||||
> = {
|
||||
user: "user",
|
||||
@@ -285,7 +285,9 @@ export class GeminiHelper {
|
||||
if (message.options && "toolResult" in message.options) {
|
||||
return "function";
|
||||
}
|
||||
return GeminiHelper.ROLES_TO_GEMINI[message.role];
|
||||
return GeminiHelper.ROLES_TO_GEMINI[
|
||||
message.role as Exclude<MessageType, "developer">
|
||||
];
|
||||
}
|
||||
|
||||
public static chatMessageToGemini(
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/groq
|
||||
|
||||
## 0.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
|
||||
## 0.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/groq",
|
||||
"description": "Groq Adapter for LlamaIndex",
|
||||
"version": "0.0.62",
|
||||
"version": "0.0.63",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/huggingface
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/huggingface",
|
||||
"description": "Huggingface Adapter for LlamaIndex",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/jinaai
|
||||
|
||||
## 0.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c63f3f]
|
||||
- @llamaindex/openai@0.3.0
|
||||
- @llamaindex/core@0.6.2
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/jinaai",
|
||||
"description": "JinaAI Adapter for LlamaIndex",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user