Skip to content

Open AI

Name of the element: Open AI

Category: Cognitive

Description: Advanced functionality. It allows integration with AI APIs by adding the possibility of integrating free conversational features and corpus-based training offered by the tool, including classifiers.

Functionality: It can be applied to any functionality offered in the OpenAi example library. Its main action is an interface or connector with the cognitive manager API. Some of the possibilities are: translations, classifiers, sentiment analysis of phrases, sarcasm generator, QnA generators (Questions and answers), List generators, keyword analysis, text-to-emoji translator, third-party voice interpreters, interview or survey questionnaires.

Note❕: For chat-oriented implementations, you can use the dedicated Chat OPENAI action from the Lynn Designer action library, which can facilitate the experience.

Open AI Action Configuration Fields

[Name]: A unique descriptor of the configuration box for identification purposes in the flow.

OPENAI Configuration Subset

[The name of the entity obtained from an expression]: An expression or entity that will contain the data to be evaluated by AI. It is also possible to concatenate phrases or action verbs to concatenate text inputs.

-- Example 1 expression: 'Translate this into Spanish: ' + OPENAI_INPUT

-- Example 2 entity: OpenAi question

[Model] (mandatory): A string expression where the model to be used for text validation must be indicated. There are models with different levels of capabilities:

-GPT-3: Sets of models that allow understanding and generating natural language

  • text-davinci-003: Allows performing any task that the other models in this set can perform, with higher quality, duration, and better instruction following. (Maximum request of 4000 tokens).

  • text-curie-001: Very capable, but faster and lower cost than Davinci (Maximum request of 2048 tokens).

  • text-babbage-001: Capable of performing simple requests, very fast and lower cost (Maximum request of 2048 tokens).

  • text-ada-001: Capable of performing very simple tasks, generally the fastest and lowest cost model. (Maximum request of 2048 tokens).

-Codex: Sets of models that allow understanding and generating code, including natural language translation to code.

  • code-davinci-002: Most capable model. Particularly good for translating natural language into code. In addition to completing the code, it allows the insertion of completions within the code. (Maximum request of 8000 tokens).

  • code-cushman-001: Almost as capable as Davinci Codex, but faster. This advantage can be used for real-time applications. (Maximum request of 2048 tokens).

  • Content Filter: A refined model that allows detecting if the text can be confidential or secure.

Note ❕: Consult the available models HERE.

The expression must be inserted between single quotes.

-- Example: 'text-davinci-003'

[Temperature] (mandatory): A float parameter that will indicate that the model will take more risks or looseness in the AI's response. If the value of 0.9 is inserted, it can be used in more creative applications and 0 for those that have a well-defined response.

The value 1 corresponds to the default value.

-- Example: 0.8

Note ❕: Check the temperature suggestions according to the selected OPENAI function (examples)

[Top_P] (mandatory): A Float parameter that will consider the % of the most frequently used words and use them in the AI response. For example, if the value 0.6 is inserted, it corresponds to the top 60% of words with the highest usage.

-- Example: 0.6

[Max_Tokens] (mandatory): An expression of Integer type that corresponds to the maximum number of tokens to generate.

Tokens can be individual words, but also characters, phrases, or sentences. They are what allow understanding and generating response texts.

Configuring a higher token value will mainly generate more complex, assertive, and higher quality responses, with the disadvantage that they may take longer to process and have a higher cost.

-- Example: 150

[Stop] (optional): Defines a text string that will stop the OPENAI engine response process.

-Example: STOP <-- f)

-- Input to analyze: 'List 10 science fiction books order by a), b), c):'

-- Result:

a) Dune by Frank Herbert

b) The Hitchhiker's Guide to the Galaxy by Douglas Adams

c) 1984 by George Orwell

d) The War of the Worlds by H.G. Wells

e) Ender's Game by Orson Scott Card

Note ❕: Note that the sequence stops when it reaches f) regardless of whether 10 items have not been listed, this represents the stop. Usually up to 4 sequences are allowed. Example reference HERE

[Authorization]: A key parameter that allows configuration of the authorization key associated with an OPENAI API query. To learn how to manage this parameter and create your own keys, see HERE

[Entity where the evaluation result will be deposited]: This field defines the name of an entity that will contain the output of the OPENAI analysis, which can be post-processed.

[Error handler]: A selection box where the intention that will be activated in case of an error in the OpenAi action is identified. When an error overflow occurs, the OpenAi_Error entity will be loaded with the error details if it is available.