Give us feedback
openai-api
Service icon

OpenAI API Wrapper

Stable version 1.0.3 (Compatible with OutSystems 11)
Uploaded on 12 Mar by 
0.0
 (0 ratings)
openai-api

OpenAI API Wrapper

Documentation
1.0.3

To use this asset, you must first get an OpenAI Key:

platform.openai.com/api-keys

These are the currently available modes:

Chat mode:

For the models: gpt-4 and gpt-3.5-turbo.


You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-4.
  • The Messages with a list of MessageItems. Where you set the roles (system, user, and assistant) and their contents (messages). I suggest to have a maximum of 5 to 6 conversations in memory.


Completion Mode (legacy):

For this mode, you will get only one answer and cannot continue a conversation:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-3.5-turbo-instruct.
  • The Prompt with the question you want to ask.
  • Max_tokens with the maximum length you expect.
  • The Temperature with a number between 0 and 1 where 0 is not creative at all and 1 is extremely creative.
  • Instructions with some message that can guide the OpenAI with what you want it to do. It's optional.


Image generation mode:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Prompt with what you want to generate.
  • The N with the number of images.
  • The Size with the expected size, for example, 256x256.

Embeddings mode:

preview

You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, text-embedding-3-small.
  • The Input with the question you want to ask.
  • The Encoding_format with the expected outcome.


Here is more info about the other available models available:

platform.openai.com/docs/models


1.0.2

To use this asset, you must first get an OpenAI Key:

platform.openai.com/api-keys

These are the currently available modes:

Chat mode:

For the models: gpt-4 and gpt-3.5-turbo.


You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-4.
  • The Messages with a list of MessageItems. Where you set the roles (system, user, and assistant) and their contents (messages). I suggest to have a maximum of 5 to 6 conversations in memory.


Completion Mode (legacy):

For this mode, you will get only one answer and cannot continue a conversation:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-3.5-turbo-instruct.
  • The Prompt with the question you want to ask.
  • Max_tokens with the maximum length you expect.
  • The Temperature with a number between 0 and 1 where 0 is not creative at all and 1 is extremely creative.
  • Instructions with some message that can guide the OpenAI with what you want it to do. It's optional.


Image generation mode:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Prompt with what you want to generate.
  • The N with the number of images.
  • The Size with the expected size, for example, 256x256.

Here is more info about the other available models available:

platform.openai.com/docs/models


1.0.1

To use this asset, you must first get an OpenAI Key:

platform.openai.com/api-keys

These are the currently available modes:

Chat mode:

For the models: gpt-4 and gpt-3.5-turbo.


You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-4.
  • The Messages with a list of MessageItems. Where you set the roles (system, user, and assistant) and their contents (messages). I suggest to have a maximum of 5 to 6 conversations in memory.


Completion Mode (legacy):

For this mode, you will get only one answer and cannot continue a conversation:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Model you want to use, for example, gpt-3.5-turbo-instruct.
  • The Prompt with the question you want to ask.
  • Max_tokens with the maximum length you expect.
  • The Temperature with a number between 0 and 1 where 0 is not creative at all and 1 is extremely creative.
  • Instructions with some message that can guide the OpenAI with what you want it to do. It's optional.


Image generation mode:

You must replace:

  • The OpenAI_APIKey with yours.
  • The Prompt with what you want to generate.
  • The N with the number of images.
  • The Size with the expected size, for example, 256x256.

Here is more info about the other available models available:

platform.openai.com/docs/models