Skip to content

v1.1.0

Compare
Choose a tag to compare
@POPPIN-FUMI POPPIN-FUMI released this 11 Aug 14:18
· 1181 commits to main since this release
1548876

Breaking Chane

  • Change default functions name from functions/openai to functions/skeet
tree . -L 2 -I node_modules 
.
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── README.md
├── functions
│   └── skeet

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

Full Changelog: v1.0.1...v1.1.0