ByteChef LogoByteChef

AI Text

AI Helper component for text analysis and generation.

Categories: Artificial Intelligence

Type: aiText/v1


Actions

Classify Text

Name: classifyText

AI reads, analyzes and classifies your text into one of defined categories.

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
textTextSTRINGThe text that is to be classified.true
categoriesCategoriesARRAY
Items [STRING]
A list of categories that the model can choose from.true
examplesExamplesOBJECT
Properties {}
You can classify a few samples, to guide your model on how to classify the real data.false
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Classify Text",
  "name" : "classifyText",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "text" : "",
    "categories" : [ "" ],
    "examples" : { },
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/classifyText"
}

Output

Sample Output:

sample category

Type: STRING

Sentiment Analysis

Name: sentimentAnalysis

The sentiment of the text is typically categorized as POSITIVE, NEGATIVE, or NEUTRAL.

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
textTextSTRINGThe text that is to be classified.true
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Sentiment Analysis",
  "name" : "sentimentAnalysis",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "text" : "",
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/sentimentAnalysis"
}

Output

Sample Output:

sample category

Type: STRING

Score

Name: score

Scores the text based on several criteria

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
textTextSTRINGThe text that is to be scored.true
criteriaCriteriaARRAY
Items [{STRING(criterion), NUMBER(lowestScore), NUMBER(highestScore), BOOLEAN(isDecimal)}]
true
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Score",
  "name" : "score",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "text" : "",
    "criteria" : [ {
      "criterion" : "",
      "lowestScore" : 0.0,
      "highestScore" : 0.0,
      "isDecimal" : false
    } ],
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/score"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Summarize Text

Name: summarizeText

AI reads, analyzes and summarizes your text into a shorter format.

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
textTextSTRINGThe text that is to be summarized.true
formatFormatSTRING
Options STRUCTURED_SUMMARY, BRIEF_TITLE, CONCISE_SENTENCE, BULLETED_LIST, CUSTOM_PROMPT
In what format do you wish the text summarized?true
promptCustom PromptSTRINGWrite your prompt for summarizing text.true
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Summarize Text",
  "name" : "summarizeText",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "text" : "",
    "format" : "",
    "prompt" : "",
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/summarizeText"
}

Output

Sample Output:

sample summarized text

Type: STRING

Name: similaritySearch

Search through a large text and find the parts that are the most relevant. Returns a JSON list.

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
textTextSTRINGThe text that is to be queried.true
queryQuerySTRINGThe term you are looking for in the text.true
numResultsNumber of resultsINTEGERNumber of relevant text sections that you want returned.true
chunkSizeChunk SizeINTEGERNumber of words around each relevant part of the result.false
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Similarity Search",
  "name" : "similaritySearch",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "text" : "",
    "query" : "",
    "numResults" : 1,
    "chunkSize" : 1,
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/similaritySearch"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Text Generation

Name: textGeneration

AI generates text based on the given prompt.

Properties

NameLabelTypeDescriptionRequired
providerProviderSTRINGtrue
modelModelSTRING
Depends On provider
The model name to use.true
modelModelSTRINGID of the model to use.true
modelURLSTRINGUrl of the inference endpoint.true
promptPromptSTRINGWrite your prompt for generating text.true
maxTokensMax TokensINTEGERThe maximum number of tokens to generate in the chat completion.false
temperatureTemperatureNUMBERControls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.false

Example JSON Structure

{
  "label" : "Text Generation",
  "name" : "textGeneration",
  "parameters" : {
    "provider" : "",
    "model" : "",
    "prompt" : "",
    "maxTokens" : 1,
    "temperature" : 0.0
  },
  "type" : "aiText/v1/textGeneration"
}

Output

Sample Output:

sample generated text.

Type: STRING

How is this guide?

Last updated on

On this page