OpenAI Operations
Learn how to carry out operations with OpenAI models in Kognitos.
Overview
The OpenAI operations in Kognitos allow you to interact with OpenAI models through structured queries. You can send messages, questions, or tasks to models like GPT-4. Additionally, you have the flexibility to utilize your own OpenAI API key for enhanced functionality.
Operations
1. Ask Koncierge
Users can leverage ask koncierge
to interact with OpenAI models. This feature simplifies tasks such as answering questions, summarizing content, and extracting information from documents. It also provides control over the response style, creativity level, output format, and selection of the OpenAI model (e.g., GPT-4 or GPT-3.5-turbo).
Syntax
To use ask koncierge
, use the following syntax:
ask koncierge
the message is "{message}" | the task is "{task}" | the question is "{question}"
the creativity is {creativity}
the openai model is "{model}"
the system command is "{command}"
the response format is "{format}"
the visual reference is {visual reference}
Inputs
Required: (one of the following)
message
: The message you want to send.task
: The specific task to be performed.question
: The question you would like answered.
π Note: If neither a message
, task
, nor question
is specified, a question will be raised.
Optional
creativity
- A number that controls the creativity of the response. Higher values produce more creative responses.
- Default: 0.0
- Range: 0.0-2.0.
model
- The OpenAI model to use to generate the response.
- Default: gpt-4-turbo-2024-04-09
command
- A system-level command or instruction that can influence the response.
- Example:
password reset instructions
format
- The desired format of the response.
- Default: string
- Allowed Values:
- string
- text
- date
- table
- list of texts
- list of numbers
- list of dates
- list of records
- structured data
- json
visual reference
:- A variable to represent a document or image that serves as a visual reference, helping GPT enhance its accuracy. This refers to a fact defined earlier in the automation.
- Examples:
the file
,the document
,the text
Example 1
π¬ Prompt
ask koncierge
the message is "Recommend a movie for a family night"
the creativity is 0.5
π Results
For a family movie night, I recommend "Paddington 2" (2017). This charming and heartwarming sequel follows Paddington Bear as he embarks on a series of adventures in an attempt to buy the perfect present for his Aunt Lucy's 100th birthday, only for the gift to be stolen. The film is known for its humor, whimsical storytelling, and strong messages about kindness and family. It's highly enjoyable for both children and adults, making it a great choice for a family gathering
Example 2
π¬ Prompt
ask koncierge
the task is "create an upper body workout routine"
the creativity is 0.8
the openai model is "gpt-4"
π Results
Workout 1: Chest and Triceps
- Warm-up: 5-10 minutes of light cardio
- Flat Barbell Bench Press: 3 sets of 8-12 reps
- Incline Dumbbell Bench Press: 3 sets of 8-12 reps
- Cable Crossover: 3 sets of 12-15 reps
- Skull Crushers: 3 sets of 8-12 reps
- Tricep Dips: 3 sets of 8-12 reps
- Tricep Pushdown: 3 sets of 12-15 reps
- Cool-down: Stretching exercises
Workout 2: Back and Biceps
- Warm-up: 5-10 minutes of light cardio
- Deadlift: 3 sets of 8-12 reps
- Bent-over Barbell Rows: 3 sets of 8-12 reps
- Wide-grip Pull-up: 3 sets of 8-12 reps
- Seated Cable Rows: 3 sets of 12-15 reps
- Barbell Curl: 3 sets of 8-12 reps
- Hammer Curl: 3 sets of 8-12 reps
- Cable Curl: 3 sets of 12-15 reps
- Cool-down: Stretching exercises
Workout 3: Shoulders and Abs
- Warm-up: 5-10 minutes of light cardio
- Overhead Press: 3 sets of 8-12 reps
- Dumbbell Lateral Raise: 3 sets of 8-12 reps
- Face Pull: 3 sets of 12-15 reps
- Plank: 3 sets of 30-60 seconds
- Bicycle Crunches: 3 sets of 15-20 reps
- Russian Twists: 3 sets of 15-20 reps
- Cool-down: Stretching exercises
Note: Rest for 60-90 seconds between sets. Adjust the weights to suit your strength levels. Always prioritize form and control over weight. If the weight is too heavy and you can't perform the exercise with proper form, reduce the weight.
Example 3
π¬ Prompt
ask koncierge
the question is "How do I reset my password?"
the system command is "short password reset instructions"
π Results
To reset your password, follow these steps:
- Go to the login page of the website or app.
- Click on the "Forgot Password?" or "Reset Password" link.
- Enter your email address or username and submit the form.
- Check your email for a password reset link from the service.
- Click on the link and follow the instructions to set a new password.
- Choose a strong, new password and confirm it.
- Log in with your new password to ensure it works.
If you don't receive an email, check your spam folder or contact support for further assistance
Example 4
π¬ Prompt
ask koncierge
the question is "What significant events happened on 14/07/1789?"
the system command is "provide historical events"
the openai model is "gpt-4-turbo-preview"
the response format is "text"
π Results
On July 14, 1789, one of the most significant events in French history occurred: the Storming of the Bastille. This event is widely regarded as a turning point in the French Revolution. The Bastille was a medieval fortress, armory, and political prison in Paris that represented royal authority in the center of the city. Its storming was driven by the revolutionaries' demand for gunpowder and arms, but more symbolically, it represented a blow against the tyranny of the Bourbon monarchy at the time.
The fall of the Bastille was celebrated in France as a national holiday, known as Bastille Day or La FΓͺte Nationale, which commemorates the beginning of the French Revolution and the eventual establishment of a republican form of government. The day is marked by festivities, parades, and fireworks, symbolizing the unity and freedom of the French people
2. Ask Koncierge To Extract Information From A Document
Use ask koncierge for
to extract information from a document.
Syntax
ask koncierge for {information} where
the document
the creativity is {creativity}
the openai model is "{model}"
the system command is "{command}"
the response format is "{format}"
the message is "{message}"
the task is "{task}"
the question is "{question}"
the rules are "{rules}"
the visual reference is {visual reference}
Inputs
Required
information
- The specific piece of information or value you are requesting from the system.
- Examples:
the invoice date
,the total amount
,the delivery status
Optional
the document
- The document from which information needs to be extracted. This will raise a question asking you to Please Provide File.
creativity
- A number that controls the creativity of the response. Higher values produce more creative responses.
- Default: 0.0
- Range: 0.0-2.0.
model
- The OpenAI model to use to generate the response.
- Default: gpt-4-turbo-2024-04-09
command
- A system-level command or instruction that can influence the response.
- Example:
password reset instructions
format
- The desired format of the response.
- Default: string
- Allowed Values:
- string
- text
- date
- table
- list of texts
- list of numbers
- list of dates
- list of records
- structured data
- json
message
- The message you want to send.
task
- The specific task to be performed.
question
- The question you would like answered.
rules
- The user rules to be followed for the task.
visual reference
- A variable to represent a document or image that serves as a visual reference, helping GPT enhance its accuracy. This refers to a fact defined earlier in the automation.
- Examples:
the file
,the document
,the text
Example 1
ask koncierge for the invoice date where
the document
the task is "extract the invoice date"
the response format is "date"
Example 2
ask koncierge for the total amount where
the document
the system command is "you are an expert invoice processor\ndo not calculate the total amount manually"
the task is "Extract the total amount"
the response format is "number"
3. Identifying Elements in a String
This section describes how to find specific elements within a given string. This operation supports singular and plural forms and can process associated questions or options.
Syntax
find the {items} in "{the text}" where
the options are "{options}"
the question is "{question}"
the response format is "{format}"
Inputs
Required
items
- The item(s) to locate within the text, which can be singular or plural.
- This can be a noun or a noun with adjectives (ex:
animal
,cute animals
).
the text
- The target string in which the item(s) are to be found.
Optional
options
- A list of options from which the thing is to be identified.
question
- A question related to the item that the function will attempt to answer based on the content of the string.
format
- The desired format of the response.
- Default: string
- Allowed Values:
- string
- text
- date
- table
- list of texts
- list of numbers
- list of dates
- list of records
- structured data
- json
Example 1
π¬ Prompt
find the people in "The project was completed by John, Sarah, and Tim."
π Breakdown
Text: The project was completed by John, Sarah, and Tim.
Items: people
Results: John, Sarah, Tim
Example 2
π¬ Prompt
find the very cute animals in "Today we saw a puppy and three kittens at the pet shop."
π Breakdown
Text: Today we saw a puppy and three kittens at the pet shop.
Items: very cute animals
Results: puppy, kittens
Example 3
π¬ Prompt
The email is "Hey Emily, I just wanted to tell you about some awesome places I visited during my vacation: Bali, Paris, and Tokyo. Can't wait to share my photos!"
find the places in the email
π Breakdown
Text: Hey Emily, I just wanted to tell you about some awesome places I visited during my vacation: Bali, Paris, and Tokyo. Can't wait to share my photos!
Items: places
Results: Bali, Paris, Tokyo
Example 4
π¬ Prompt
the memo is "Reminder: Don't forget to check out the new cafΓ©s I visited this weekend: Java House and CafΓ© Mocha."
find the sweet spots in the memo
π Breakdown
Text: Reminder: Don't forget to check out the new cafΓ©s I visited this weekend: Java House and CafΓ© Mocha.
Items: sweet spots
Results: Java House, CafΓ© Mocha
Example 5: Using Additional Options
π¬ Prompt
find the movies in "Recently watched films: 'Inception', 'The Matrix', and 'The Godfather'" where
the question is "Which movies are sci-fi?"
the options are "sci-fi, drama"
π Breakdown
Text: Recently watched films: 'Inception', 'The Matrix', and 'The Godfather'
Items: movies
Results: 'Inception' and 'The Matrix'
4. Extracting Data
This operation extracts data from sources like texts, documents, or files.
Syntax
extract data from the {source}
the creativity is {creativity}
the openai model is "{model}"
the output format is "{output format}"
the visual reference is {visual reference}
the first field is "{field}"
the first field's rule is "{field rule}"
the first field's default value is "{field default}"
the first field's format is "{field format}"
Inputs
Required
source
- A variable to represent the information source to extract data from
- Examples:
document
,file
,text
.
field
- A field to be extracted from the text or file.
- You can add any number of fields, but at least 1 is required.
- Examples:
invoice number
,date
.
Optional
creativity
- A number that controls the creativity of the response. Higher values produce more creative responses.
- Default: 0.0
- Range: 0.0-2.0.
model
- The OpenAI model to use to generate the response.
- Default: gpt-4o-latest
output format
- The desired format of the response.
- Default: string
- Allowed Values:
- string
- text
- date
- table
- list of texts
- list of numbers
- list of dates
- list of records
- structured data
- json
visual reference
- A variable to represent a document or image that serves as a visual reference, helping GPT enhance its accuracy. This refers to a fact defined earlier in the automation.
- Examples
the file
,the document
,the text
field rule
- The rule to be followed for the field extraction.
field default
- The field's default value.
field format
- The format of the fields that need to be extracted from the text.
- Possible values:
number
,string
,date
.
Example
extract data from the file
the openai model is "gpt-4o-latest"
the visual reference is the file
the first field is "invoice number"
the first field's format is "number"
the first field's rule is "keep just the first four digits"
the second field is "invoice amounts"
the second field's format is "string"
the second field's rule is "keep just the amount without the currency"
the third field is "invoice date"
the third field's format is "date"
the data's invoice amounts
get the invoice number from the data
5. Extracting Tables
This operation extracts a table from a source, such as a document or file.
Syntax
extract a table from {source}
the description is "{description}"
the creativity is {creativity}
the openai model is "{model}"
the visual reference is {visual reference}
the extraction mode is "{extraction mode}"
Inputs
Required
source
- A variable to represent the information source to extract a table from.
- Examples:
document
,file
,text
description
- A description of the table to be extracted.
Optional
creativity
- A number that controls the creativity of the response. Higher values produce more creative responses.
- Default: 0.0
- Range: 0.0-2.0.
model
- The OpenAI model to use to generate the response.
- Default: gpt-4o-latest
visual reference
- A variable to represent a document or image that serves as a visual reference, helping GPT enhance its accuracy. This refers to a fact defined earlier in the automation.
- Examples
the file
,the document
,the text
extraction mode
- A string that represents the accuracy as it sends location data to GPT
- Allowed Values:
precise
Example
extract a table from the document
the openai model is "gpt-4o"
the visual reference is the document
the extraction mode is "precise"
the description is "The table has invoice number, date and amount. the amount should not have the currency
in it. Keep only the first 4 digits of the invoice number. It has only one row of data."
the table
Using An OpenAI API Key
These operations enable you to use your own OpenAI API key for enhanced functionality. Adding the following line will prompt the platform to request your key:
the department's openai key
This OpenAI key will be the default for all processes in the department.
OpenAI Models
Here is a list of OpenAI models available for use. These are Azure hosted models.
Models Available in the EU
gpt-4
gpt-3.5-turbo
gpt-4-vision-preview
gpt-4-turbo
gpt-4o
gpt-4o-latest
gpt-4o-mini
Models Available in the US
gpt-4o-mini
gpt-4
gpt-4o
gpt-4o-latest
gpt-4-latest
gpt-4-turbo
gpt-4-turbo-latest
gpt-4-vision-preview
gpt-4-vision-preview-latest
gpt-3.5-turbo
gpt-3.5-turbo-latest
Updated 3 days ago