Textrazor

Learn how to use Textrazor with Composio

Overview

SLUG: TEXTRAZOR

Description

TextRazor is a natural language processing API that extracts meaning, entities, and relationships from text, powering advanced content analysis and sentiment detection

Authentication Details

generic_api_key
stringRequired

Connecting to Textrazor

Create an auth config

Use the dashboard to create an auth config for the Textrazor toolkit. This allows you to connect multiple Textrazor accounts to Composio for agents to use.

1

Select App

Navigate to Textrazor.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Textrazor Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4textrazor_auth_config_id = "ac_YOUR_TEXTRAZOR_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": user_api_key}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Textrazor for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, textrazor_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Textrazor toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["TEXTRAZOR"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Get Account Information

Description

This tool retrieves comprehensive information about a textrazor account, providing essential details about the account's status, usage, and limits. it returns an account object containing properties such as the current subscription plan, concurrent request limits, and daily usage among others, making it crucial for monitoring api usage, managing requests, and ensuring compliance with subscription limits.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Classify Text

Description

This tool will classify text into predefined categories using textrazor's classification capabilities. it takes input text, optional cleanup mode and language, and returns a list of relevant categories with their confidence scores from the analysis. the tool supports various built-in classifiers including: - textrazor iab: iab qag segments - textrazor iab content taxonomy 3.0: iab content taxonomy v3.0 (2022) - textrazor mediatopics 2023q1: latest iptc media topics (march 2023) - and other versions of these taxonomies

Action Parameters

classifiers
stringRequired
cleanup_mode
stringDefaults to raw
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Manage Custom Classifiers

Description

This tool manages custom classifiers in textrazor, allowing users to create, update, and manage custom classification categories.

Action Parameters

categories
array
category_id
string
classifier_id
stringRequired
limit
integer
offset
integer
operation
stringRequired

Action Response

data
object
error
string
message
stringRequired
success
booleanRequired
successful
booleanRequired

Tool Name: Analyze Dependency Trees

Description

The dependencytreesaction analyzes the grammatical relationships between words in text by creating dependency trees. it provides detailed syntactic analysis by identifying the grammatical relationships between words and their parent words in a sentence. this tool is useful for: - understanding sentence structure - analyzing grammatical relationships - parsing complex sentences - supporting advanced linguistic analysis tasks

Action Parameters

cleanup_mode
stringDefaults to raw
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Dictionary Manager

Description

The textrazor dictionary manager tool allows users to create, update, and manage custom entity dictionaries in textrazor. it provides endpoints for creating/updating dictionaries, listing dictionaries, getting a specific dictionary, and deleting dictionaries, as well as managing the entries within these dictionaries (adding, retrieving, and deleting entries).

Action Parameters

dictionary_id
string
entries
array
operation
stringRequired

Action Response

data
object
error
string
message
stringRequired
ok
booleanRequired
successful
booleanRequired

Tool Name: Extract Entailments from Text

Description

This tool extracts entailments from text using textrazor's api. it identifies words or phrases that can be logically inferred from the given text by analyzing logical implications and relationships.

Action Parameters

cleanup_mode
string
cleanup_return_cleaned
boolean
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Extract Named Entities from Text

Description

Extract named entities (people, places, companies, etc.) from text using textrazor's entity extraction api. the tool will identify and classify named entities within the provided text, returning detailed information about each entity including its type, confidence score, and relevance score.

Action Parameters

cleanup_mode
stringDefaults to raw
entities_allow_overlap
booleanDefaults to True
entities_filter_dbpedia_types
array
entities_filter_freebase_types
array
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Extract Phrases from Text

Description

The extractphrases action extracts meaningful phrases from input text using textrazor's phrase extraction capability. it analyzes text to identify important phrases and multi-word expressions that aid in tasks like content analysis, keyword extraction, and summarization.

Action Parameters

cleanup_mode
stringDefaults to raw
language
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Extract Grammatical Relations from Text

Description

This tool extracts grammatical relations between words in the text. it identifies the relationships between different parts of sentences, including subjects, objects, and predicates. the relations extractor provides detailed syntactic analysis of the text.

Action Parameters

cleanup_mode
stringDefaults to raw
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Extract Word Senses

Description

This tool performs word sense disambiguation on the input text by identifying the most likely meanings of words in context. it uses textrazor's 'senses' extractor to determine the semantic meaning and provides detailed data including word, sense, confidence score, part of speech, position, synset, and definition.

Action Parameters

cleanupMode
stringDefaults to raw
languageOverride
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Spelling Correction

Description

This tool performs spelling correction on the provided text using textrazor's deep spelling correction system. it analyzes the input text for spelling errors and provides context-based corrections.

Action Parameters

cleanup_mode
stringDefaults to cleanHTML
language
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Analyze Content with TextRazor

Description

A comprehensive content analysis tool that combines multiple textrazor extractors to perform a complete analysis of the input text. this action allows users to analyze text content with multiple extractors in a single api call.

Action Parameters

cleanup_mode
stringDefaults to stripTags
cleanup_return_cleaned
boolean
cleanup_use_metadata
booleanDefaults to True
extractors
arrayDefaults to ['entities', 'topics', 'words', 'phrases', 'dependency-trees', 'relations', 'entailments', 'senses']
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Extract Topics from Text

Description

A tool to extract topics from text using textrazor's topic extraction capabilities. topics represent the main themes and concepts discussed in the text, with relevance scores indicating their importance to the document.

Action Parameters

cleanup_mode
string
language_override
string
text
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired