Skip to content

Commit 1351036

Browse files
authored
Update AI assistant for stablecoin and real world asset (#408)
1 parent c0c172c commit 1351036

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

packages/ui/api/ai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import OpenAI from 'https://esm.sh/[email protected]'
22
import { OpenAIStream, StreamingTextResponse } from 'https://esm.sh/[email protected]'
3-
import { erc20Function, erc721Function, erc1155Function, governorFunction, customFunction } from '../src/wiz-functions.ts'
3+
import { erc20Function, erc721Function, erc1155Function, stablecoinFunction, realWorldAssetFunction, governorFunction, customFunction } from '../src/wiz-functions.ts'
44
import { Redis } from 'https://esm.sh/@upstash/[email protected]'
55

66
export default async (req: Request) => {
@@ -39,7 +39,7 @@ export default async (req: Request) => {
3939
model: 'gpt-4-1106-preview',
4040
messages,
4141
functions: [
42-
erc20Function, erc721Function, erc1155Function, governorFunction, customFunction
42+
erc20Function, erc721Function, erc1155Function, stablecoinFunction, realWorldAssetFunction, governorFunction, customFunction
4343
],
4444
temperature: 0.7,
4545
stream: true

packages/ui/src/Wiz.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
erc721: 'ERC721',
3939
erc1155: 'ERC1155',
4040
stablecoin: 'Stablecoin',
41+
realworldasset: 'RealWorldAsset',
4142
governor: 'Governor',
4243
custom: 'Custom',
4344
}
@@ -109,6 +110,8 @@
109110
if (opts.access === 'false') { opts.access = false }
110111
if (opts.upgradeable === 'false') { opts.upgradeable = false }
111112
if (opts.timelock === 'false') { opts.timelock = false }
113+
if (opts.votes === 'false') { opts.votes = false }
114+
if (opts.limitations === 'false') { opts.limitations = false }
112115
if (opts.proposalThreshold) { opts.proposalThreshold = opts.proposalThreshold.toString() }
113116
if (opts.quorumAbsolute) { opts.quorumAbsolute = opts.quorumAbsolute.toString() }
114117
if (opts.premint) { opts.premint = opts.premint.toString() }

packages/ui/src/wiz-functions.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,28 @@ export const erc1155Function = {
8787
}
8888
}
8989

90+
export const stablecoinFunction = {
91+
name: 'stablecoin',
92+
description: 'Make a stablecoin token that uses the ERC-20 standard. Emphasize that this is experimental, and some features are not audited and subject to change.',
93+
parameters: {
94+
type: 'object',
95+
properties: {
96+
...erc20Function.parameters.properties,
97+
custodian: { type: 'boolean', description: 'Whether authorized accounts can freeze and unfreeze accounts for regulatory or security purposes. This feature is experimental, not audited and is subject to change.' },
98+
// 'false' gets converted to false
99+
limitations: { type: 'string', enum: ['false', 'allowlist', 'blocklist'], description: 'Whether to restrict certain users from transferring tokens, either via allowing or blocking them. This feature is experimental, not audited and is subject to change.' },
100+
upgradeable: { type: 'string', enum: ['false'], description: 'Upgradeability is not yet available for features that use @openzeppelin/community-contracts' },
101+
},
102+
required: ['name', 'symbol'],
103+
}
104+
}
105+
106+
export const realWorldAssetFunction = {
107+
name: 'realworldasset',
108+
description: 'Make a real-world asset token that uses the ERC-20 standard. Emphasize that this is experimental, and some features are not audited and subject to change.',
109+
parameters: stablecoinFunction.parameters,
110+
}
111+
90112
export const governorFunction = {
91113
name: 'governor',
92114
description: 'Make a contract to implement governance, such as for a DAO',

0 commit comments

Comments
 (0)