Files
log10go/docs/sdks/feedbacktasks
2024-05-24 18:29:28 -07:00
..
2024-05-24 18:29:28 -07:00

FeedbackTasks

(FeedbackTasks)

Overview

FeedbackTasks

Available Operations

  • List - List feedback tasks.
  • Create - Create a new task.
  • Get - Retrieves feedback task taskId.

List

List feedback tasks.

Example Usage

package main

import(
	"github.com/log10-io/log10go"
	"context"
	"log"
)

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

    ctx := context.Background()
    res, err := s.FeedbackTasks.List(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.Tasks != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.

Response

*operations.ListFeedbackTasksResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

Create

Create a new task.

Example Usage

package main

import(
	"github.com/log10-io/log10go"
	"github.com/log10-io/log10go/models/components"
	"context"
	"log"
)

func main() {
    s := log10go.New(
        log10go.WithSecurity("<YOUR_API_KEY_HERE>"),
        log10go.WithXLog10Organization("<value>"),
    )
    var request *components.Task = &components.Task{
        JSONSchema: components.JSONSchema{},
        Name: "<value>",
        Instruction: "<value>",
        CompletionTagsSelector: components.CompletionTagsSelector{},
    }
    ctx := context.Background()
    res, err := s.FeedbackTasks.Create(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.Task != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request components.Task ✔️ The request object to use for the request.

Response

*operations.CreateFeedbackTaskResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

Get

Retrieves feedback task taskId.

Example Usage

package main

import(
	"github.com/log10-io/log10go"
	"context"
	"log"
)

func main() {
    s := log10go.New(
        log10go.WithSecurity("<YOUR_API_KEY_HERE>"),
        log10go.WithXLog10Organization("<value>"),
    )
    var taskID string = "<value>"
    ctx := context.Background()
    res, err := s.FeedbackTasks.Get(ctx, taskID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Task != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
taskID string ✔️ The task id to fetch.

Response

*operations.GetFeedbackTaskResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /