Skip to main content

QGPT API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
hintsPOST /qgpt/hints/qgpt/hints [POST]
personsRelatedPOST /qgpt/persons/related/qgpt/persons/related [POST]
qgptStreamGET /qgpt/stream/qgpt/stream [WS]
questionPOST /qgpt/question/qgpt/question [POST]
relevancePOST /qgpt/relevance/qgpt/relevance [POST]
repromptPOST /qgpt/reprompt/qgpt/reprompt [POST]

hints

QGPTQuestionOutput hints(qgPTHintsInput)

/qgpt/hints [POST]

Generates suggested questions that users can ask. It accepts the answer displayed to the user, relevant code snippets used for the answer, and the previous query as inputs. In return, it provides a list of questions that can be presented to the user.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val qgPTHintsInput : QGPTHintsInput = // QGPTHintsInput |
try {
val result : QGPTQuestionOutput = apiInstance.hints(qgPTHintsInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#hints")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#hints")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
qgPTHintsInputQGPTHintsInput[optional]

Return type

QGPTQuestionOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

personsRelated

QGPTPersonsRelatedOutput personsRelated(transferables, qgPTPersonsRelatedInput)

/qgpt/persons/related [POST]

Utilize this endpoint for Who Support, identifying individuals who can provide assistance when given context such as a Seed or a QGPT Conversation, for example. Input: - (optional) seed: Seed - Only supports fragments for now. - (optional) conversation: QGPTConversation. Output: - persons: Persons

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val qgPTPersonsRelatedInput : QGPTPersonsRelatedInput = // QGPTPersonsRelatedInput |
try {
val result : QGPTPersonsRelatedOutput = apiInstance.personsRelated(transferables, qgPTPersonsRelatedInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#personsRelated")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#personsRelated")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
qgPTPersonsRelatedInputQGPTPersonsRelatedInput[optional]

Return type

QGPTPersonsRelatedOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

qgptStream

QGPTStreamOutput qgptStream(qgPTStreamInput)

/qgpt/stream [WS]

Provides a WebSocket connection that streams inputs to the qGPT model. It handles relevance and questions, but will throw an error if both are passed in simultaneously. However, if you wish to utilize both question and relevance, you can obtain stream results by passing relevance with the option 'question:true'. It is designed to manage multiple conversations.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val qgPTStreamInput : QGPTStreamInput = // QGPTStreamInput |
try {
val result : QGPTStreamOutput = apiInstance.qgptStream(qgPTStreamInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#qgptStream")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#qgptStream")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
qgPTStreamInputQGPTStreamInput[optional]

Return type

QGPTStreamOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

question

QGPTQuestionOutput question(qgPTQuestionInput)

/qgpt/question [POST]

Processes relevant code snippets or UUIDs returned from the /qgpt/relevance endpoint, along with a question query, to provide possible answers. Note: - Relevant seeds must either include an ID used within the /qgpt/relevance endpoint or a seed with a fragment/string; otherwise, an error will be thrown. - This endpoint utilizes your query and relevant snippets to generate multiple answers, each accompanied by a score.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val qgPTQuestionInput : QGPTQuestionInput = // QGPTQuestionInput |
try {
val result : QGPTQuestionOutput = apiInstance.question(qgPTQuestionInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#question")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#question")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
qgPTQuestionInputQGPTQuestionInput[optional]

Return type

QGPTQuestionOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

relevance

QGPTRelevanceOutput relevance(qgPTRelevanceInput)

/qgpt/relevance [POST]

This is the first phase to the QGPT flow. Please one of the following. 1. provide an absolute path on the users machine that we can use locally. 2. provide Seeds that you want to compare to, which will be ONLY fragment/string values(all other values will be ignored) 3. provide assets, here you can provide an iterable of the asset id, and we will do the rest 4. you can set your database boolean to true which will tell us to use your entire DB as the query space. required - query: string; This is the question of the user. optional - question: boolean; This will by-pass the second endpoint and just ask the question and return the results(as an ease of use bool) This endpoint will embed everything. and will return the relevance snippets that we will use in the next phase, to answer your question. on the UI: we can show this to users (around this is the snippets we used to answer your question.) Next: feed this information to the /qgpt/question [POST] endpoint to get your question answered.(unless you included the question:true optional boolean, then you will get the results from here.)

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val qgPTRelevanceInput : QGPTRelevanceInput = // QGPTRelevanceInput |
try {
val result : QGPTRelevanceOutput = apiInstance.relevance(qgPTRelevanceInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#relevance")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#relevance")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
qgPTRelevanceInputQGPTRelevanceInput[optional]

Return type

QGPTRelevanceOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

reprompt

QGPTRepromptOutput reprompt(qgPTRepromptInput)

/qgpt/reprompt [POST]

This will take in a followup question and the history of the conversation, and emit your a prompt or query that you can pass to the /qgpt/relevance and then the /qgpt/question endpoint to get your next answer.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = QGPTApi()
val qgPTRepromptInput : QGPTRepromptInput = // QGPTRepromptInput |
try {
val result : QGPTRepromptOutput = apiInstance.reprompt(qgPTRepromptInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling QGPTApi#reprompt")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling QGPTApi#reprompt")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
qgPTRepromptInputQGPTRepromptInput[optional]

Return type

QGPTRepromptOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json