Coder Social home page Coder Social logo

membrane-driver-openai's Introduction

OpenAI Driver

This driver lets you interact with OpenAI through your Membrane graph.

Queries

List models:

mctl query 'openai:models.page' '{ id owned_by object }'

Result:
[
 {
    "id": "text-davinci:001",
    "owned_by": "system",
    "object": "model"
  },
  {
    "id": "text-curie:001",
    "owned_by": "system",
    "object": "model"
  },
  {
    "id": "text-babbage:001",
    "owned_by": "openai",
    "object": "model"
  }
  ...
]

Actions

Create completion

mctl action 'openai:models.one(id:"text-davinci-001").complete(prompt:"what is vercel")'

Result:
"Vercel is a cloud platform for static sites and serverless functions."

Create image

mctl action 'openai:generateImage(prompt:"real martian")'

Result:
[
  {
    "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-axt0lBVwbIkPQaaB9sZUFdv7/user-ZOh1OVZ0EmR0PozpSWPBD5rQ/img-MnHioaTxosecDF2F2SylWI6e.png?st=2023-01-04T02%3A51%3A49Z&se=2023-01-04T04%3A51%3A49Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-01-03T23%3A25%3A38Z&ske=2023-01-04T23%3A25%3A38Z&sks=b&skv=2021-08-06&sig=2L6qXg95yKUrm/Z0p%2B7TjynxW4qN9k5wrZMOt0/AO34%3D"
  },
  ...
]

Create moderation

mctl action 'openai:models.one(id:"text-moderation-stable").moderate(input:"I want to kill you")'

Result:
{
  "hate": false,
  "hate/threatening": false,
  "self-harm": false,
  "sexual": false,
  "sexual/minors": false,
  "violence": true,
  "violence/graphic": false
}

Create edit

mctl action 'openai:models.one(id:"text-davinci-edit-001").edit(input:"what ares wikipedia?", instruction:"Fix the spelling mistakes")'

Result:
"What is wikipedia?"

Schema

Types

<Root>
    - Fields
        status -> String
        models -> Ref<ModelsCollection>
        fineTunes -> Ref<FineTunesCollection>
        files -> Ref<FilesCollection>
    - Actions
        configure -> Void
        generateImage -> List<Image>
<ModelsCollection>
    - Fields
        one -> <Model>
        page -> List<Model>
<FineTunesCollection>
    - Fields
        one -> <FineTune>
        page -> List<FineTune>
<FilesCollection>
    - Fields
        one -> <File>
        page -> List<File>
<Model>
    - Field
        id -> String
        onject -> String
        owned_by -> Int
    - Actions
        complete -> String
        chat -> String
        moderate -> Ref<Moderation>
        edit -> String
<File>
    - Field
        id -> String
        onject -> String
        bytes -> Int
        created_at -> Int
        filename -> String
        purpose -> String
<FineTuned>
    - Field
        id -> 
        object -> String
        model -> String
        hyperparams -> Ref<Hyperparams>
        fine_tuned_model -> String
        organization_id -> String
        status -> String
        created_at -> Int
        updated_at -> Int
        events -> List<Event>
        result_files -> List<File>
        training_files -> List<File>
        validation_files -> List<File>
<Hyperparams>
    - Fields
        batch_size -> Int
        learning_rate_multiplayer -> Float
        n_epochs -> Int
        prompt_loss_weight -> Float
<Event>
    - Fields
        object -> String
        created_at -> Int
        level -> String
        message -> String
<Image>
    - Fields
        url -> String
<Moderation>
    - Fields
        violence/graphic -> String
        violence -> String
        sexual/minors -> String
        sexual -> String
        self-harm -> String
        hate/threatening -> String
        hate -> String 

membrane-driver-openai's People

Contributors

aranajhonny avatar juancampa avatar

Stargazers

Roman avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.