v1.1.0
Breaking Chane
- Change default functions name from
functions/openai
tofunctions/skeet
tree . -L 2 -I node_modules
.
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── README.md
├── functions
│ └── skeet
- @skeet-framework/ai as default to call OpenAiAPI and VertextAI
@skeet-framework/ai
openAI
import { OpenAI, OpenAIPromptParams } from '@skeet-framework/ai'
const run = async () => {
const prompt: OpenAIPromptParams = {
messages: [
{
role: 'system',
content:
'You are a developer who is knowledgeable about the Skeet framework, a framework for building web applications.',
},
{
role: 'user',
content:
'What is the Skeet framework and what benefits does it offer for app development?',
},
{
role: 'assistant',
content:
'The Skeet framework is an open-source full-stack app development solution that aims to lower the development and operation cost of applications. It allows developers to focus more on the application logic and worry less about infrastructure. The framework can be assembled with a combination of SQL and NoSQL.',
},
{
role: 'user',
content: 'Tell me about the Skeet framework.',
},
],
}
const openAi = new OpenAI()
const result = await openAi.prompt(prompt)
console.log('Question:\n', prompt.messages[3].content)
console.log('\nAnswer:\n', result)
const content =
'The Skeet framework is an open-source full-stack app development solution that aims to lower the development and operation cost of applications. It allows developers to focus more on the application logic and worry less about infrastructure. The framework can be assembled with a combination of SQL and NoSQL.'
const title = await openAi.generateTitle(content)
console.log('\nOriginal content:\n', content)
console.log('\nGenerated title:\n', title)
}
run()
VertexAI
import { VertexAI, VertexPromptParams } from '@skeet-framework/ai'
const run = async () => {
const prompt: VertexPromptParams = {
context:
'You are a developer who is knowledgeable about the Skeet framework, a framework for building web applications.',
examples: [
{
input: {
content:
'What is the Skeet framework and what benefits does it offer for app development?',
},
output: {
content:
'The Skeet framework is an open-source full-stack app development solution that aims to lower the development and operation cost of applications. It allows developers to focus more on the application logic and worry less about infrastructure. The framework can be assembled with a combination of SQL and NoSQL.',
},
},
],
messages: [
{
author: 'user',
content: 'Tell me about the Skeet framework.',
},
],
}
const vertexAi = new VertexAI()
const response = await vertexAi.prompt(prompt)
console.log('Generated message:\n', response)
const content =
'The Skeet framework is an open-source full-stack app development solution that aims to lower the development and operation cost of applications. It allows developers to focus more on the application logic and worry less about infrastructure. The framework can be assembled with a combination of SQL and NoSQL.'
const promptTitle = await vertexAi.generateTitlePrompt(content)
const title = await vertexAi.prompt(promptTitle)
console.log('\nGenerated title:\n', title)
}
run()
New Features
- Added
skeet iam ai
command
Activate VertexAI Permissions and Roles
$ skeet iam ai
What's Changed
- update readme by @KishiTheMechanic in #34
- update iam for AI by @POPPIN-FUMI in #35
- update readme by @KishiTheMechanic in #36
- packages by @KishiTheMechanic in #37
- add iam ai by @POPPIN-FUMI in #38
Full Changelog: v1.0.1...v1.1.0