Getting Started
This guide explains how to use Outerport’s Python SDK to make API calls.Installation
You can install the Outerport Python SDK from PyPI (Python Package Index).Initializing the Client
To use the Outerport Python SDK, you need to first get your Outerport API key.Currently, the Outerport API is invite only. To get access, please contact us at support@outerport.com.
Using a Self-Hosted Outerport API service
If you are hosting your own Outerport API, you can set thebase_url
to the URL of your hosted API.
Basic Usage
Uploading a Document
You can upload a document using theclient.documents.create
method.
client.documents.create
method returns a Document
object.
The Outerport Python SDK returns an object when creating a “resource”. The returned object is connected to the client, so you can call the
reload()
method to get the latest data or the delete()
method to delete it.Asking a Question
You can ask a question about a document using theclient.questions.create
method.
client.questions.create
method returns a Question
object.
question.final_answer
, the question.plan
and question.evidences
contain the process of answering the question. For example, question.evidences
returns the following result:
Searching for Relevant Documents
You can search for relevant documents using theclient.documents.search
method.
client.documents.search
method returns a list of Document
objects.
You can also specify a tag or folder to search for.