Skip to content

Question File

askFile

The askFile() function allows you to ask a question or make a query related to a specific file. It requires the file ID and a query string as input.

1
2
3
4
5
6
7
8
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

file_id = "docs/file123.pdf"
query = "What is the content of this file?"

result = blip_obj.askFile(id=file_id, query=query)

answerQuestion

The answerQuestion() function provides an answer to a query based on the provided text. It requires the text, a query, and an optional language parameter to return a response.

1
2
3
4
5
6
7
8
9
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

text = "The capital of France is Paris."
query = "What is paris in relation to France?"
language = "spanish"

result = blip_obj.answerQuestion(text=text, query=query, language=language)

routeQuery

The routeQuery() function routes a query based on the provided text. It requires a text input that will be processed to determine whether it belongs to the normal chat category or it requires a document to respond.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

text = "What is the weather like today?"

result = blip_obj.routeQuery(text=text)

analyzeCSV

The analyzeCSV() function analyzes a CSV file based on a provided query. It requires the file ID and the query as input to process and return the analysis results.

1
2
3
4
5
6
7
8
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="csv_analysis")

file_id = "docs/file123.csv"
query = "Summarize the data in the CSV."

result = blip_obj.analyzeCSV(id=file_id, query=query)