GPT Skill
GPT is an AI language model capable of generating human-like text.
Integrate GPT skill into One AI’s pipeline in order to:
- BUILD EFFICIENT AND DYNAMIC PROMPTS BY ONLY USING THE RELEVANT DATA
Dynamically build short and efficient prompts, providing cut costs and reduced response times. Extract highlights or summaries from input text using One AI's Language Skills, and feed only the relevant data to GPT.
This process has several advantages, including support for unlimited input length, cost and runtime efficiency, and the ability to select only relevant input for GPT based on specific Skills like sentiment, action-items, sales-insights, and more.
- GIVE GPT CONTEXT FROM YOUR KNOWLEDGE BASE
With One AI's clustering analytics engine, businesses can power their GPT apps with their knowledge base. The analytics engine enables businesses to search their knowledge base by meaning and find the most relevant articles, which can then be attached to the GPT prompts as context. With all the relevant information present, GPT will provide factually accurate responses.
- MONITOR GENERATED TEXT
Postprocess and analyze text generated by GPT to monitor and to assure compliance. Use Skills such as Topics, Names to validate that the relevant subjects are included in the text, or Sentiment and Emotions to make sure that GPT's replies are compliant and have an appropriate tone.
GPT (Generative Pre-trained Transformer) is a family of natural language processing models that use deep learning techniques to generate coherent and grammatically correct text. The models are "pre-trained" because they are first trained on large amounts of text data, such as Wikipedia articles, to learn patterns in language.
Here are some example use cases to what can be done using GPT skill along with One AI pipeline:
Input | One AI Processing | GPT Prompt | Notes |
---|---|---|---|
100K blog posts | Extract blog highlights | Write a summary based on only the highlights | ~80% input length reduction compared to using the full text |
1M product reviews | Detect sentences with positive or negative sentiment | Write a pros/cons section for the product | Reduced noise, which will result in more accurate and focused responses |
Knowledge-base of 100K articles and a question written by a user | Find the most relevant article to answer the user's question | Write an answer based on the information in the article | GPT has the needed context to answer the question, which will result in much more accurate & useful responses |
Parameters
Name | Type | Description | Required? |
---|---|---|---|
gpt_engine | string | The GPT model to be used in the process (davinci, curie, babbage, or ada) | Yes |
input_skill | string | The previous skill in the pipeline, which generates the text input that will be used in the GPT prompt | No |
prompt | string | The instructions to be provided for GPT in the full prompt | No |
gpt_api_key | string | Your OpenAI API Key | No |
prompt_fields | list | The desired keys in the JSON output (dictionary) | No |
prompt_position | string | Defines if the output from the input skill will appear before or after the instructions in the full prompt that will be sent to GPT. Eitherstart or end | No |
Choose the model to be used in the pipeline:
- "text-davinci-003" - Most capable GPT-3 model. Can do any task the other models can do, often with higher quality
- "text-curie-001" - Very capable, faster and lower cost than Davinci.
- "text-babbage-001" - Capable of straightforward tasks, very fast, and lower cost
- "text-ada-001" - Capable of very simple tasks, usually the fastest model in the GPT-3 series, and lowest cost
Example
Request
{
"input": "donald duck and mickey mouse",
"input_type": "article",
"output_type": "json",
"multilingual": {
"enabled": true
},
"steps": [
{
"skill": "names"
},
{
"skill": "gpt",
"params": {
"input_skill": "names",
"gpt_engine": "text-davinci-003",
"prompt_position": "start",
"gpt_api_key": "<YOUR GPT API KEY>",
"prompt": "write a poem about these names"
}
},
{
"skill": "keywords"
}
]
}
Response
{
"input": [
{
"utterance": "donald duck and mickey mouse"
}
],
"status": "success",
"output": [
{
"text_generated_by_step_name": "input",
"text_generated_by_step_id": 0,
"contents": [
{
"utterance": "donald duck and mickey mouse"
}
],
"labels": [
{
"type": "name",
"skill": "names",
"name": "PERSON",
"value": "donald duck",
"data": {},
"span_text": "donald duck",
"span": [
0,
11
],
"output_spans": [
{
"section": 0,
"start": 0,
"end": 11
}
]
},
{
"type": "name",
"skill": "names",
"name": "PERSON",
"value": "mickey mouse",
"data": {},
"span_text": "mickey mouse",
"span": [
16,
28
],
"output_spans": [
{
"section": 0,
"start": 16,
"end": 28
}
]
}
]
},
{
"text_generated_by_step_name": "gpt",
"text_generated_by_step_id": 2,
"contents": [
{
"utterance": "\n\nDonald Duck and Mickey Mouse,\nTwo of the most famous in the house.\nTheir names are known around the world,\nTheir fame is something that's rarely heard.\n\nDonald Duck is the quack of the day,\nHis silly antics make us laugh and play.\nHe's always getting into some kind of trouble,\nBut his friends are always there to help him double.\n\nMickey Mouse is the leader of the pack,\nHis courage and bravery never lack.\nHe's always ready to take on a challenge,\nAnd his friends are always there to manage.\n\nDonald Duck and Mickey Mouse,\nTwo of the most famous in the house.\nTheir names are known around the world,\nTheir fame is something that's rarely heard."
}
],
"labels": [
{
"type": "keyword",
"skill": "keywords",
"name": "mickey mouse",
"value": 0.098,
"span_text": "Mickey Mouse",
"span": [
18,
30
],
"output_spans": [
{
"section": 0,
"start": 18,
"end": 30
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "mickey mouse",
"value": 0.098,
"span_text": "Mickey Mouse",
"span": [
334,
346
],
"output_spans": [
{
"section": 0,
"start": 334,
"end": 346
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "mickey mouse",
"value": 0.098,
"span_text": "Mickey Mouse",
"span": [
513,
525
],
"output_spans": [
{
"section": 0,
"start": 513,
"end": 525
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "donald duck",
"value": 0.087,
"span_text": "Donald Duck",
"span": [
2,
13
],
"output_spans": [
{
"section": 0,
"start": 2,
"end": 13
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "donald duck",
"value": 0.087,
"span_text": "Donald Duck",
"span": [
155,
166
],
"output_spans": [
{
"section": 0,
"start": 155,
"end": 166
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "donald duck",
"value": 0.087,
"span_text": "Donald Duck",
"span": [
497,
508
],
"output_spans": [
{
"section": 0,
"start": 497,
"end": 508
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "house",
"value": 0.062,
"span_text": "house",
"span": [
62,
67
],
"output_spans": [
{
"section": 0,
"start": 62,
"end": 67
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "house",
"value": 0.062,
"span_text": "house",
"span": [
557,
562
],
"output_spans": [
{
"section": 0,
"start": 557,
"end": 562
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "friends",
"value": 0.059,
"span_text": "friends",
"span": [
288,
295
],
"output_spans": [
{
"section": 0,
"start": 288,
"end": 295
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "friends",
"value": 0.059,
"span_text": "friends",
"span": [
460,
467
],
"output_spans": [
{
"section": 0,
"start": 460,
"end": 467
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "famous",
"value": 0.058,
"span_text": "famous",
"span": [
48,
54
],
"output_spans": [
{
"section": 0,
"start": 48,
"end": 54
}
]
},
{
"type": "keyword",
"skill": "keywords",
"name": "famous",
"value": 0.058,
"span_text": "famous",
"span": [
543,
549
],
"output_spans": [
{
"section": 0,
"start": 543,
"end": 549
}
]
}
]
}
],
"stats": {
"concurrency_wait_time": 0.0,
"total_running_jobs": 487,
"total_waiting_jobs": 0
}
}
Updated 2 months ago