@gram-ai/elements 1.14.0 → 1.15.0
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 +1 -32
- package/dist/components/FrontendTools/index.d.ts +4 -0
- package/dist/elements.cjs +23 -27
- package/dist/elements.css +1 -1
- package/dist/elements.js +4519 -5938
- package/dist/index-Bq3DSKiX.cjs +60 -0
- package/dist/index-cubKOZsm.js +14647 -0
- package/dist/index.d.ts +2 -0
- package/dist/lib/tools.d.ts +22 -0
- package/dist/server.cjs +15 -38
- package/dist/server.js +1931 -8561
- package/dist/types/index.d.ts +177 -2
- package/package.json +2 -2
- package/dist/index-DxNldiiY.js +0 -6560
- package/dist/index-IZN-i8ZU.cjs +0 -33
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { ElementsProvider as GramElementsProvider } from './contexts/ElementsProvider';
|
|
2
2
|
export { useElements as useGramElements } from './hooks/useElements';
|
|
3
3
|
export { Chat } from './components/Chat';
|
|
4
|
+
export { defineFrontendTool } from './lib/tools';
|
|
5
|
+
export type { FrontendTool } from './lib/tools';
|
|
4
6
|
export type { ElementsConfig, ComposerConfig, AttachmentsConfig, ModalConfig, SidecarConfig, ToolsConfig, ModelConfig, ThemeConfig, WelcomeConfig, Suggestion, Model, ModalTriggerPosition, ColorScheme, Radius, Density, Variant, Dimensions, Dimension, } from './types';
|
|
5
7
|
export type { Plugin } from './types/plugins';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSONSchema7 } from 'ai';
|
|
2
|
+
import { AssistantToolProps, Tool } from '@assistant-ui/react';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
export declare const toAISDKTools: (tools: Record<string, Tool>) => {
|
|
5
|
+
[k: string]: {
|
|
6
|
+
parameters: JSONSchema7;
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const getEnabledTools: (tools: Record<string, Tool>) => {
|
|
11
|
+
[k: string]: Tool;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A frontend tool is a tool that is defined by the user and can be used in the chat.
|
|
15
|
+
*/
|
|
16
|
+
export type FrontendTool<TArgs extends Record<string, unknown>, TResult> = FC<AssistantToolProps<TArgs, TResult>> & {
|
|
17
|
+
unstable_tool: AssistantToolProps<TArgs, TResult>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Make a frontend tool
|
|
21
|
+
*/
|
|
22
|
+
export declare const defineFrontendTool: <TArgs extends Record<string, unknown>, TResult>(tool: Tool, name: string) => FrontendTool<TArgs, TResult>;
|