Files
sdk/responseinputitem.go
7758be4af2 release: 0.1.0-alpha.6 (#16)
* chore: sync repo

* release: 0.1.0-alpha.6

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-08 18:10:23 -07:00

55 lines
1.8 KiB
Go

// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package hanzoai
import (
"context"
"errors"
"fmt"
"net/http"
"slices"
"github.com/hanzoai/go-sdk/internal/requestconfig"
"github.com/hanzoai/go-sdk/option"
)
// ResponseInputItemService contains methods and other services that help with
// interacting with the Hanzo API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewResponseInputItemService] method instead.
type ResponseInputItemService struct {
Options []option.RequestOption
}
// NewResponseInputItemService generates a new service that applies the given
// options to each request. These options are applied after the parent client's
// options (if there is one), and before any request-specific options.
func NewResponseInputItemService(opts ...option.RequestOption) (r *ResponseInputItemService) {
r = &ResponseInputItemService{}
r.Options = opts
return
}
// Get input items for a response.
//
// Follows the OpenAI Responses API spec:
// https://platform.openai.com/docs/api-reference/responses/input-items
//
// ```bash
// curl -X GET http://localhost:4000/v1/responses/resp_abc123/input_items -H "Authorization: Bearer sk-1234"
// ```
func (r *ResponseInputItemService) List(ctx context.Context, responseID string, opts ...option.RequestOption) (res *ResponseInputItemListResponse, err error) {
opts = slices.Concat(r.Options, opts)
if responseID == "" {
err = errors.New("missing required response_id parameter")
return nil, err
}
path := fmt.Sprintf("v1/responses/%s/input_items", responseID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return res, err
}
type ResponseInputItemListResponse = interface{}