Skip to content

Commit

Permalink
Squash changeset on feature/conversation-handler branch and fix api c…
Browse files Browse the repository at this point in the history
…heck (#1949)

* squash changeset

* fix api check

* grrr
  • Loading branch information
sobolk authored Sep 3, 2024
1 parent 5f84553 commit 6ee7d08
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 90 deletions.
7 changes: 5 additions & 2 deletions .changeset/blue-tigers-cover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
'@aws-amplify/ai-constructs': patch
'@aws-amplify/ai-constructs': minor
'@aws-amplify/backend-ai': minor
'@aws-amplify/backend-function': patch
'@aws-amplify/platform-core': minor
---

Add Bedrock tools to conversation handler
Add new @aws-amplify/ai-constructs and @aws-amplify/backend-ai packages with a conversation handler.
2 changes: 0 additions & 2 deletions .changeset/breezy-files-wait.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/eleven-crews-remain.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fifty-bags-type.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/fuzzy-books-shave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fuzzy-parents-sing.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/long-chairs-march.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lucky-rabbits-decide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/modern-vans-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/poor-dodos-compare.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/short-files-judge.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spicy-swans-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-fireants-speak.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/tender-fishes-drive.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wicked-baboons-beam.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wicked-crabs-switch.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/backend-ai/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ declare namespace __export__conversation {
}
export { __export__conversation }

declare namespace __export__conversation_runtime {
declare namespace __export__conversation__runtime {
export {
ToolResultContentBlock,
ExecutableTool,
ConversationTurnEvent,
handleConversationTurnEvent
}
}
export { __export__conversation_runtime }
export { __export__conversation__runtime }

// @public (undocumented)
type ConversationTurnEvent = runtime.ConversationTurnEvent;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend-ai/src/index.internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
import * as __export__conversation from './conversation/index.js';
// eslint-disable-next-line @typescript-eslint/naming-convention
import * as __export__conversation_runtime from './conversation/runtime/index.js';
import * as __export__conversation__runtime from './conversation/runtime/index.js';

/*
Api-extractor does not ([yet](https://github.com/microsoft/rushstack/issues/1596)) support multiple package entry points
Because this package has a submodule export, we are working around this issue by including that export here and directing api-extract to this entry point instead
This allows api-extractor to pick up the submodule exports in its analysis
*/

export { __export__conversation, __export__conversation_runtime };
export { __export__conversation, __export__conversation__runtime };
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,19 @@ export class ImportStatementsRenderer {
To work around this we use 'index.internal.ts' files where we export entry points as namespaces.
Api validator uses special naming convention for these special exports and converts them into start imports
so that they look like imported namespace.
The convention in 'index.internal.ts' files is as follows.
Assume that package exports 'someEntryPoint/someSubEntryPoint' pointing to 'someSubEntryPoint.js' (arbitrary file).
'index.internal.ts' should:
1. 'import * as __exports__someEntryPoint__someSubEntryPoint from './someSubEntryPoint.js'
2. export { __exports__someEntryPoint__someSubEntryPoint }
3. Where:
1. __exports__ indicates this workaround to our tooling (e.g. this code)
2. __ is a convention to express nesting and is translated to /
*/
const entryPointPath = namespaceName.replace('__export__', '');
const entryPointPath = namespaceName
.replace('__export__', '') // strip prefix
.replaceAll('__', '/'); // replace __ with /
importStatements.push(
`import * as ${namespaceName} from '${this.packageName}/${entryPointPath}';`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@ declare namespace __export__other_entry_point {
}
}

export type SomeTypeUnderNestedEntryPoint = {
somePropertyUnderNestedEntryPoint: string;
}

declare namespace __export__other_entry_point__some_nested_entry_point {
export {
SomeTypeUnderNestedEntryPoint
}
}

```
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"import": "./lib/some_other_entry_point.js",
"require": "./lib/some_other_entry_point.js",
"types": "./lib/some_other_entry_point.d.ts"
},
"./other_entry_point/some_nested_entry_point": {
"import": "./lib/some_nested_entry_point.js",
"require": "./lib/some_nested_entry_point.js",
"types": "./lib/some_nested_entry_point.d.ts"
}
},
"types": "lib/index.d.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type SomeTypeUnderNestedEntryPoint = {
somePropertyUnderNestedEntryPoint: string;
};

0 comments on commit 6ee7d08

Please sign in to comment.