Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.51 KB

README.md

File metadata and controls

62 lines (46 loc) · 2.51 KB

Rag

(Rag)

Overview

Available Operations

  • Query - Query using RAG Search

Query

Query across your connected data sources using RAG Search

Example Usage

package main

import(
	gosdk "github.com/panoratech/go-sdk"
	"context"
	"github.com/panoratech/go-sdk/models/components"
	"log"
)

func main() {
    s := gosdk.New(
        gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Rag.Query(ctx, "<value>", components.QueryBody{
        Query: "When does Panora incorporated?",
        TopK: gosdk.Float64(3),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.RagQueryOutputs != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
xConnectionToken string ✔️ The connection token
queryBody components.QueryBody ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.QueryResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*