Filler Words
The Flyflow API provides a way to get recommended filler words and their probabilities by making a GET request to the /filler-words
endpoint. This endpoint analyzes the provided text and returns suggested filler words along with their likelihoods.
Request
Endpoint
GET /filler-words
Headers
Authorization
: The API key prefixed withBearer
. Example:Bearer your_api_key
.Content-Type
: The content type of the request. Must be set toapplication/json
.
Query Parameters
The request should include the following query parameter:
text
(string, required): The text for which you want to get recommended filler words.
cURL Example
curl -X GET \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
"https://api.flyflow.dev/v1/filler-words?text=Your text here"
Replace your_api_key
with your actual API key and Your text here
with the text you want to analyze.
Python Client Example
from flyflowclient import Flyflow
client = Flyflow(api_key='your_api_key')
text = 'Your text here'
filler_words = client.get_filler_words(text=text)
print(filler_words)
Replace your_api_key
with your actual API key and Your text here
with the text you want to analyze.
Response
Status Codes
200 OK
: The request was successful, and the recommended filler words are returned.400 Bad Request
: The request query parameter is missing or invalid.401 Unauthorized
: The API key is missing or invalid.500 Internal Server Error
: An unexpected error occurred on the server side.
Response Body
If the request is successful, the response body will be a JSON object containing the recommended filler word and their associated probabilities:
{
"recommended_word": "um",
"probabilities": {
"um": 0.75,
"uh": 0.15,
"er": 0.10
}
}
recommended_word
(string): The recommended filler word.probabilities
(object): A dictionary of filler words and their probabilities.
Error Handling
If an error occurs during the request, the API will return an appropriate error response with a corresponding status code and error message in the response body.
For example, if the text
query parameter is missing:
{
"error": "Bad Request",
"message": "Text is required"
}
Make sure to handle errors appropriately in your application and provide the correct query parameters and valid data in the request.
Conclusion
Fetching recommended filler words using the Flyflow API is straightforward. By making a GET request to the /filler-words
endpoint with the required text
query parameter, you can retrieve suggested filler words and their probabilities. The API will return the recommended filler word and their associated probabilities upon success. Remember to handle errors and provide the necessary authentication and valid data to ensure a smooth integration with the Flyflow platform.
Updated 6 months ago