@rcrsr/rill-ext-openai 0.8.3 → 0.8.5
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/dist/index.d.ts +81 -4
- package/dist/index.js +940 -14
- package/package.json +10 -6
- package/dist/factory.d.ts +0 -27
- package/dist/factory.d.ts.map +0 -1
- package/dist/factory.js +0 -768
- package/dist/factory.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts +0 -11
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,87 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { ExtensionResult } from '@rcrsr/rill';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Base configuration for LLM extensions
|
|
7
|
+
*/
|
|
8
|
+
export interface LLMExtensionConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Model name (e.g., "gpt-4", "claude-3-opus")
|
|
11
|
+
*/
|
|
12
|
+
readonly model: string;
|
|
13
|
+
/**
|
|
14
|
+
* Sampling temperature (0.0-2.0 inclusive)
|
|
15
|
+
*/
|
|
16
|
+
readonly temperature?: number | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* API key for authentication
|
|
19
|
+
*/
|
|
20
|
+
readonly api_key: string;
|
|
21
|
+
/**
|
|
22
|
+
* Base URL for API endpoint
|
|
23
|
+
*/
|
|
24
|
+
readonly base_url?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Model name for embedding operations
|
|
27
|
+
*/
|
|
28
|
+
readonly embed_model?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Extended configuration for LLM providers with retry and timeout options
|
|
32
|
+
*/
|
|
33
|
+
interface LLMProviderConfig extends LLMExtensionConfig {
|
|
34
|
+
/**
|
|
35
|
+
* Maximum number of retry attempts on failure
|
|
36
|
+
*/
|
|
37
|
+
readonly max_retries?: number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Request timeout in milliseconds
|
|
40
|
+
*/
|
|
41
|
+
readonly timeout?: number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum tokens to generate
|
|
44
|
+
*/
|
|
45
|
+
readonly max_tokens?: number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* System message content
|
|
48
|
+
*/
|
|
49
|
+
readonly system?: string | undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Configuration options for OpenAI extension.
|
|
53
|
+
* Re-exports LLMProviderConfig from shared package.
|
|
54
|
+
*/
|
|
55
|
+
export type OpenAIExtensionConfig = LLMProviderConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Create OpenAI extension instance.
|
|
58
|
+
* Validates configuration and returns host functions with cleanup.
|
|
59
|
+
*
|
|
60
|
+
* @param config - Extension configuration
|
|
61
|
+
* @returns ExtensionResult with message, messages, embed, embed_batch, tool_loop and dispose
|
|
62
|
+
* @throws Error for invalid configuration (EC-1 through EC-4)
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const ext = createOpenAIExtension({
|
|
67
|
+
* api_key: process.env.OPENAI_API_KEY,
|
|
68
|
+
* model: 'gpt-4-turbo',
|
|
69
|
+
* temperature: 0.7
|
|
70
|
+
* });
|
|
71
|
+
* // Use with rill runtime...
|
|
72
|
+
* await ext.dispose();
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function createOpenAIExtension(config: OpenAIExtensionConfig): ExtensionResult;
|
|
1
76
|
/**
|
|
2
77
|
* @rcrsr/rill-ext-openai
|
|
3
78
|
*
|
|
4
79
|
* Extension for OpenAI API integration with rill scripts.
|
|
5
80
|
*/
|
|
6
81
|
export declare const VERSION = "0.0.1";
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
LLMProviderConfig as LLMExtensionConfig,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export {};
|