Skip to content

Commit

Permalink
Export interfaces/types as 'type' (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbleigh authored Oct 23, 2024
1 parent 9b29ea4 commit 30aef48
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 102 deletions.
30 changes: 15 additions & 15 deletions js/ai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

export { Document, DocumentData, DocumentDataSchema } from './document.js';
export { Document, DocumentDataSchema, type DocumentData } from './document.js';
export {
embed,
embedderRef,
Expand Down Expand Up @@ -48,26 +48,26 @@ export {
type GenerateStreamResponse,
} from './generate.js';
export {
GenerateRequest,
GenerateRequestData,
GenerateResponseData,
GenerationCommonConfigSchema,
GenerationUsage,
MediaPart,
MessageData,
MessageSchema,
ModelArgument,
ModelReference,
ModelRequest,
ModelRequestSchema,
ModelResponseData,
ModelResponseSchema,
Part,
PartSchema,
Role,
RoleSchema,
ToolRequestPart,
ToolResponsePart,
type GenerateRequest,
type GenerateRequestData,
type GenerateResponseData,
type GenerationUsage,
type MediaPart,
type MessageData,
type ModelArgument,
type ModelReference,
type ModelRequest,
type ModelResponseData,
type Part,
type Role,
type ToolRequestPart,
type ToolResponsePart,
} from './model.js';
export {
definePrompt,
Expand Down
2 changes: 1 addition & 1 deletion js/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ export {
export * from './flowTypes.js';
export * from './plugin.js';
export * from './reflection.js';
export { JSONSchema, defineJsonSchema, defineSchema } from './schema.js';
export { defineJsonSchema, defineSchema, type JSONSchema } from './schema.js';
export * from './telemetryTypes.js';
export * from './utils.js';
168 changes: 84 additions & 84 deletions js/genkit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,21 @@
*/

export {
BaseDataPointSchema,
CommonLlmOptions,
Document,
DocumentData,
DocumentDataSchema,
EmbedderAction,
EmbedderArgument,
EmbedderInfo,
EmbedderParams,
EmbedderReference,
Embedding,
EvalResponses,
EvaluatorAction,
EvaluatorInfo,
EvaluatorParams,
EvaluatorReference,
GenerateOptions,
GenerateRequest,
GenerateRequestData,
GenerateResponse,
GenerateResponseData,
GenerateStreamOptions,
GenerateStreamResponse,
GenerationBlockedError,
GenerationCommonConfigSchema,
GenerationResponseError,
GenerationUsage,
IndexerAction,
IndexerArgument,
IndexerInfo,
IndexerParams,
IndexerReference,
LlmResponse,
LlmResponseSchema,
LlmStats,
LlmStatsSchema,
MediaPart,
Message,
MessageData,
MessageSchema,
ModelArgument,
ModelId,
ModelIdSchema,
ModelReference,
ModelRequest,
ModelRequestSchema,
ModelResponseData,
ModelResponseSchema,
Part,
PartSchema,
PromptAction,
PromptConfig,
PromptFn,
RankedDocument,
RerankerAction,
RerankerArgument,
RerankerInfo,
RerankerParams,
RerankerReference,
RetrieverAction,
RetrieverArgument,
RetrieverInfo,
RetrieverParams,
RetrieverReference,
Role,
RoleSchema,
Tool,
ToolAction,
ToolArgument,
ToolCall,
ToolCallSchema,
ToolConfig,
ToolRequestPart,
ToolResponsePart,
ToolSchema,
asTool,
embedderRef,
Expand All @@ -98,44 +39,78 @@ export {
retrieverRef,
toGenerateRequest,
toToolWireFormat,
type BaseDataPointSchema,
type CommonLlmOptions,
type DocumentData,
type EmbedderAction,
type EmbedderArgument,
type EmbedderInfo,
type EmbedderParams,
type EmbedderReference,
type Embedding,
type EvalResponses,
type EvaluatorAction,
type EvaluatorInfo,
type EvaluatorParams,
type EvaluatorReference,
type GenerateOptions,
type GenerateRequest,
type GenerateRequestData,
type GenerateResponse,
type GenerateResponseData,
type GenerateStreamOptions,
type GenerateStreamResponse,
type GenerationUsage,
type IndexerAction,
type IndexerArgument,
type IndexerInfo,
type IndexerParams,
type IndexerReference,
type LlmResponse,
type LlmStats,
type MediaPart,
type MessageData,
type ModelArgument,
type ModelId,
type ModelReference,
type ModelRequest,
type ModelResponseData,
type Part,
type PromptAction,
type PromptConfig,
type PromptFn,
type RankedDocument,
type RerankerAction,
type RerankerArgument,
type RerankerInfo,
type RerankerParams,
type RerankerReference,
type RetrieverAction,
type RetrieverArgument,
type RetrieverInfo,
type RetrieverParams,
type RetrieverReference,
type Role,
type Tool,
type ToolAction,
type ToolArgument,
type ToolCall,
type ToolConfig,
type ToolRequestPart,
type ToolResponsePart,
} from '@genkit-ai/ai';
export {
Action,
ActionMetadata,
CallableFlow,
Flow,
FlowActionInput,
FlowActionInputSchema,
FlowAuthPolicy,
FlowConfig,
FlowError,
FlowErrorSchema,
FlowFn,
FlowInvokeEnvelopeMessage,
FlowInvokeEnvelopeMessageSchema,
FlowResponseSchema,
FlowResultSchema,
FlowServer,
FlowServerOptions,
GENKIT_CLIENT_HEADER,
GENKIT_VERSION,
GenkitError,
JSONSchema,
JSONSchema7,
Middleware,
ReflectionServer,
ReflectionServerOptions,
RunActionResponse,
RunActionResponseSchema,
SideChannelData,
Status,
StatusCodes,
StatusSchema,
StreamableFlow,
StreamingCallback,
StreamingFlowConfig,
TelemetryConfig,
__RequestWithAuth,
defineFlow,
defineJsonSchema,
defineSchema,
Expand All @@ -149,6 +124,31 @@ export {
run,
runWithStreamingCallback,
z,
type Action,
type ActionMetadata,
type CallableFlow,
type Flow,
type FlowActionInput,
type FlowAuthPolicy,
type FlowConfig,
type FlowError,
type FlowFn,
type FlowInvokeEnvelopeMessage,
type FlowResponseSchema,
type FlowResultSchema,
type FlowServerOptions,
type JSONSchema,
type JSONSchema7,
type Middleware,
type ReflectionServerOptions,
type RunActionResponse,
type SideChannelData,
type Status,
type StreamableFlow,
type StreamingCallback,
type StreamingFlowConfig,
type TelemetryConfig,
type __RequestWithAuth,
} from '@genkit-ai/core';
export { loadPromptFile } from '@genkit-ai/dotprompt';
export * from './genkit.js';
9 changes: 7 additions & 2 deletions js/plugins/dotprompt/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ import {
defineDotprompt,
Dotprompt,
DotpromptRef,
PromptGenerateOptions,
type PromptGenerateOptions,
} from './prompt.js';
import { loadPromptFolder, lookupPrompt } from './registry.js';

export { type PromptMetadata } from './metadata.js';
export { defineHelper, definePartial } from './template.js';
export { defineDotprompt, Dotprompt, loadPromptFolder, PromptGenerateOptions };
export {
defineDotprompt,
Dotprompt,
loadPromptFolder,
type PromptGenerateOptions,
};

export interface DotpromptPluginOptions {
// Directory to look for .prompt files.
Expand Down

0 comments on commit 30aef48

Please sign in to comment.