Skip to content

Commit

Permalink
Merge branch 'main' into storage-access-outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpascual committed Sep 6, 2024
2 parents 6ef5567 + 1505414 commit dfcfde5
Show file tree
Hide file tree
Showing 104 changed files with 4,562 additions and 115 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-hounds-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-deployer': patch
---

surface synth errors if the function declaration files have not been written yet.
5 changes: 0 additions & 5 deletions .changeset/friendly-cameras-trade.md

This file was deleted.

3 changes: 3 additions & 0 deletions .eslint_dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"amazoncognito",
"amplifyconfiguration",
"ampx",
"anthropic",
"apns",
"apollo",
"appleid",
"appsync",
"argv",
Expand All @@ -21,6 +23,7 @@
"changeset",
"changesets",
"chown",
"claude",
"cloudformation",
"codebase",
"codegen",
Expand Down
78 changes: 59 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions packages/ai-constructs/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Be very careful editing this file. It is crafted to work around [this issue](https://github.com/npm/npm/issues/4479)

# First ignore everything
**/*

# Then add back in transpiled js and ts declaration files
!lib/**/*.js
!lib/**/*.d.ts

# Then ignore test js and ts declaration files
*.test.js
*.test.d.ts

# This leaves us with including only js and ts declaration files of functional code
135 changes: 135 additions & 0 deletions packages/ai-constructs/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
## API Report File for "@aws-amplify/ai-constructs"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

/// <reference types="node" />

import * as bedrock from '@aws-sdk/client-bedrock-runtime';
import { Construct } from 'constructs';
import { FunctionResources } from '@aws-amplify/plugin-types';
import { ResourceProvider } from '@aws-amplify/plugin-types';
import * as smithy from '@smithy/types';

declare namespace __export__conversation {
export {
ConversationHandlerFunction,
ConversationHandlerFunctionProps
}
}
export { __export__conversation }

declare namespace __export__conversation__runtime {
export {
ConversationMessage,
ConversationMessageContentBlock,
ConversationTurnEvent,
ExecutableTool,
handleConversationTurnEvent,
ToolDefinition,
ToolExecutionInput,
ToolInputSchema,
ToolResultContentBlock
}
}
export { __export__conversation__runtime }

// @public
class ConversationHandlerFunction extends Construct implements ResourceProvider<FunctionResources> {
constructor(scope: Construct, id: string, props: ConversationHandlerFunctionProps);
// (undocumented)
resources: FunctionResources;
}

// @public (undocumented)
type ConversationHandlerFunctionProps = {
entry?: string;
models: Array<{
modelId: string;
region?: string;
}>;
};

// @public (undocumented)
type ConversationMessage = {
role: 'user' | 'assistant';
content: Array<ConversationMessageContentBlock>;
};

// @public (undocumented)
type ConversationMessageContentBlock = bedrock.ContentBlock | {
image: Omit<bedrock.ImageBlock, 'source'> & {
source: {
bytes: string;
};
};
};

// @public (undocumented)
type ConversationTurnEvent = {
conversationId: string;
currentMessageId: string;
responseMutation: {
name: string;
inputTypeName: string;
selectionSet: string;
};
graphqlApiEndpoint: string;
modelConfiguration: {
modelId: string;
systemPrompt: string;
region?: string;
inferenceConfiguration?: {
maxTokens?: number;
temperature?: number;
topP?: number;
};
};
request: {
headers: {
authorization: string;
};
};
messages: Array<ConversationMessage>;
toolsConfiguration?: {
dataTools?: Array<ToolDefinition & {
graphqlRequestInputDescriptor: {
queryName: string;
selectionSet: string;
propertyTypes: Record<string, string>;
};
}>;
clientTools?: Array<ToolDefinition>;
};
};

// @public (undocumented)
type ExecutableTool = ToolDefinition & {
execute: (input: ToolExecutionInput | undefined) => Promise<ToolResultContentBlock>;
};

// @public
const handleConversationTurnEvent: (event: ConversationTurnEvent, props?: {
tools?: Array<ExecutableTool>;
}) => Promise<void>;

// @public (undocumented)
type ToolDefinition = {
name: string;
description: string;
inputSchema: ToolInputSchema;
};

// @public (undocumented)
type ToolExecutionInput = smithy.DocumentType;

// @public (undocumented)
type ToolInputSchema = bedrock.ToolInputSchema;

// @public (undocumented)
type ToolResultContentBlock = bedrock.ToolResultContentBlock;

// (No @packageDocumentation comment for this package)

```
21 changes: 21 additions & 0 deletions packages/ai-constructs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @aws-amplify/ai-constructs

## 0.1.2

### Patch Changes

- daac630: Remove runtime namespace from main exports

## 0.1.1

### Patch Changes

- 61669ff: Handle base64 images in conversation handler
- da9c60c: Add main entry point in ai-constructs package
- c17e397: Un-peer Bedrock dependencies

## 0.1.0

### Minor Changes

- 99c8b6a: Add new @aws-amplify/ai-constructs and @aws-amplify/backend-ai packages with a conversation handler.
Loading

0 comments on commit dfcfde5

Please sign in to comment.