Skip to content

Commit

Permalink
Use AiModel from data-schema-types as possible input (aws-amplify#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk authored Oct 21, 2024
1 parent 5f46d8d commit 0d6489d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-jokes-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-data': patch
---

Update data-schema-types
5 changes: 5 additions & 0 deletions .changeset/tough-taxis-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-ai': patch
---

Use AiModel from data-schema-types as possible input
38 changes: 19 additions & 19 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions packages/backend-ai/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
```ts

import { AiModel } from '@aws-amplify/data-schema-types';
import { ConstructFactory } from '@aws-amplify/plugin-types';
import { ConversationTurnEventVersion } from '@aws-amplify/ai-constructs/conversation';
import { FunctionResources } from '@aws-amplify/plugin-types';
Expand Down Expand Up @@ -49,9 +50,7 @@ type DefineConversationHandlerFunctionProps = {
name: string;
entry?: string;
models: Array<{
modelId: string | {
resourcePath: string;
};
modelId: string | AiModel;
region?: string;
}>;
};
Expand Down
1 change: 1 addition & 0 deletions packages/backend-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@aws-amplify/ai-constructs": "^0.6.0",
"@aws-amplify/backend-output-schemas": "^1.3.0",
"@aws-amplify/backend-output-storage": "^1.0.2",
"@aws-amplify/data-schema-types": "^1.2.0",
"@aws-amplify/platform-core": "^1.1.0",
"@aws-amplify/plugin-types": "^1.0.1"
},
Expand Down
8 changes: 2 additions & 6 deletions packages/backend-ai/src/conversation/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@aws-amplify/ai-constructs/conversation';
import path from 'path';
import { CallerDirectoryExtractor } from '@aws-amplify/platform-core';
import { AiModel } from '@aws-amplify/data-schema-types';

class ConversationHandlerFunctionGenerator
implements ConstructContainerEntryGenerator
Expand Down Expand Up @@ -115,12 +116,7 @@ export type DefineConversationHandlerFunctionProps = {
name: string;
entry?: string;
models: Array<{
modelId:
| string
| {
// This is to match return of 'a.ai.model.anthropic.claude3Haiku()'
resourcePath: string;
};
modelId: string | AiModel;
region?: string;
}>;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"@aws-amplify/backend-output-schemas": "^1.1.0",
"@aws-amplify/data-construct": "^1.10.1",
"@aws-amplify/plugin-types": "^1.2.2",
"@aws-amplify/data-schema-types": "^1.1.1"
"@aws-amplify/data-schema-types": "^1.2.0"
}
}

0 comments on commit 0d6489d

Please sign in to comment.