Quickstart
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.
Once you have your API key, you can initialize the client as follows:
Using a Self-Hosted Outerport API service
If you are hosting your own Outerport API, you can set the base_url
to the URL of your hosted API.
Basic Usage
Uploading a Document
You can upload a document using the client.documents.create
method.
The 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 the client.questions.create
method.
The client.questions.create
method returns a Question
object.
In addition to the 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 the client.documents.search
method.
The client.documents.search
method returns a list of Document
objects.
You can also specify a tag or folder to search for.