HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

Create Embedding for a Document

Embeddings are required in order to use Certara GPT to generate content off a specific document or set of documents.

Pre-Reqs

In order to create an embedding of a document, we require a documentId. We will be using the documentId from Upload a Document.

We will be using the same header from Define Your Header.

👍

Check Your Imported Modules

Make sure you have imported the requests and json module before proceeding with this guide.

Request Embedding Creation

We can jump right into creating our request, since a body is not required for an embedding to be created.

documentId = 'AYXGsE6FbZ95yV31x8iZ'
creatDocuemntEmbeddingUrl = f'{envUrl}/layar/sourceDocument/{documentId}/createEmbeddings'

response = requests.post(createDocumentEmbeddingUrl,
                         headers = header
                        )

print(response.text) #optional

The printed response will be "200" which indicates the embedding was created.