Coder Social home page Coder Social logo

appwrite's Introduction

๐Ÿค– Python Prompt ChatGPT Function

Ask question, and let OpenAI GPT-3.5-turbo answer.

๐Ÿงฐ Usage

GET /

HTML form for interacting with the function.

POST /

Query the model for a completion.

Parameters

Name Description Location Type Sample Value
Content-Type The content type of the request body Header application/json N/A
prompt Text to prompt the model Body String Write a haiku about Mondays

Sample 200 Response:

Response from the model.

{
  "ok": true,
  "completion": "Monday's heavy weight, Dawning with a sigh of grey, Hopeful hearts await."
}

Sample 400 Response:

Response when the request body is missing.

{
  "ok": false,
  "error": "Missing body with a prompt."
}

Sample 500 Response:

Response when the model fails to respond.

{
  "ok": false,
  "error": "Failed to query model."
}

โš™๏ธ Configuration

Setting Value
Runtime Python (3.9)
Entrypoint src/main.py
Build Commands pip install -r requirements.txt
Permissions any
Timeout (Seconds) 15

๐Ÿ”’ Environment Variables

OPENAI_API_KEY

A unique key used to authenticate with the OpenAI API. Please note that this is a paid service and you will be charged for each request made to the API. For more information, see the OpenAI pricing page.

Question Answer
Required Yes
Sample Value sk-wzG...vcy
Documentation OpenAI Docs

OPENAI_MAX_TOKENS

The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens.

Question Answer
Required No
Sample Value 512
Documentation OpenAI: What are tokens?

appwrite's People

Contributors

teamappwrite avatar

Watchers

Roman Dolgiy 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.