OpenAI Chat Completion

Objective 3Sixty supports the use of Artificial Intelligence for processing document in a multitude of ways by using OpenAI Chat Completions Task. Q&A, Metadata Extraction, Text Summarization and PII Detection are just a handful of many example use cases for this task. Chat Completions is simply the umbrella term that is used to describe Artificial Intelligence features in a chat-like manner.

The Objective OpenAI Chat Completions task can be used by any "OpenAI Like" servers and not just OpenAI. That is to say, any server providing an interface similar to that of OpenAI can be used with this task.


Configuration

To use this task go to the task tab in your job. Select the task from the drop down and click the plus circle to configure the task. Click done after making any changes to save.

Condition check

It will execute the task when the condition's result is 'true', 't', 'on', '1', or 'yes' (case-insensitive), or run on all conditions if left empty. This condition is evaluated for each document, determining whether the task should be executed based on the specified values.

Example: If I only want to run this task for PDF documents I would use the expression: equals('#{rd.mimetype}',"application/pdf")

To perform Chat Completions, the following parameters must be provided:

Server

An OpenAI Like server that supports chat completions

API Key

If the server requires a key, it must be provided

Model

If the server requires a model name (in case of servers supporting many models) it must be provided

System prompt

Set the overall behavior of the AI assistant (must be a 3Sixty expression language)

User prompt

Set the specific request to be asked from the AI assistant (must be a 3Sixty expression language)

JSON Format

Checking this box allows the user to request a valid JSON format response. This feature is model dependent, which means not all models will honor it. Depending on the Chat Completions API server and model you are using, you need to set or unset this.

Timeout

Server timeout in seconds

Result Field

Result field containing AI response to be added to the document


Examples

Following is an example that depicts using this task for document summarization. (It assumes that the document text was extracted into `content` field, perhaps using Tika, or any other method of user's choice)


API Keys

Processor: openAiChatCompletionTask

Key

Display Name

Type

use_condition Check a condition before executing this task. Boolean

task_condition

Condition

String

task_stop_proc

Stop Processing

Boolean

open_ai_server

Server

String

open_ai_api_key

API Key

String

open_ai_model

Model

String

open_ai_system

System Prompt

String

open_ai_user

User Prompt

String

open_ai_json

JSON Format

Boolean

open_ai_timeout

Timeout

INTEGER

open_ai_result

Result Field

String


Helpful References: Chat Completions API