Documentation
¶
Overview ¶
Package projects provides operations for managing Braintrust projects.
New REST integrations should use github.com/braintrustdata/braintrust-sdk-go/openapi instead.
Index ¶
- type APIdeprecated
- func New(client *https.Client) *APIdeprecated
- func (a *API) Create(ctx context.Context, params CreateParams) (*Project, error)deprecated
- func (a *API) Delete(ctx context.Context, id string) errordeprecated
- func (a *API) Get(ctx context.Context, id string) (*Project, error)deprecated
- func (a *API) List(ctx context.Context, params ListParams) (*ListResponse, error)deprecated
- type CreateParams
- type ListParams
- type ListResponse
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API
deprecated
type API struct {
// contains filtered or unexported fields
}
API provides operations for managing Braintrust projects.
Deprecated: Use openapi.Client or openapi.ClientWithResponses.
func New
deprecated
New creates a new projects API client.
Deprecated: Use openapi.NewClientWithResponses.
func (*API) Create
deprecated
Create creates a new project or returns an existing one if a project with the same name already exists. This operation is idempotent.
Example:
project, err := client.Projects().Create(ctx, projects.CreateParams{
Name: "my-project",
})
Deprecated: Use openapi.ClientWithResponses.PostProjectWithResponse.
func (*API) List
deprecated
func (a *API) List(ctx context.Context, params ListParams) (*ListResponse, error)
List retrieves a list of projects with optional filtering.
Example:
projects, err := client.Projects().List(ctx, projects.ListParams{
Limit: 10,
})
Deprecated: Use openapi.ClientWithResponses.GetProjectWithResponse.
type CreateParams ¶
type CreateParams struct {
// Name is the name of the project (required).
Name string `json:"name"`
// OrgID optionally specifies which organization to create the project under.
// If empty, uses the default organization for the API key.
OrgID string `json:"org_id,omitempty"`
}
CreateParams contains parameters for creating a project.
type ListParams ¶
type ListParams struct {
// OrgID filters projects by organization ID.
OrgID string
// Limit is the maximum number of projects to return.
Limit int
}
ListParams contains parameters for listing projects.
type ListResponse ¶
type ListResponse struct {
// Objects is the list of projects returned.
Objects []Project `json:"objects"`
}
ListResponse represents the response from listing projects.
type Project ¶
type Project struct {
// ID is the unique identifier for the project.
ID string `json:"id"`
// Name is the human-readable name of the project.
Name string `json:"name"`
// OrgID is the organization ID that owns this project.
OrgID string `json:"org_id,omitempty"`
}
Project represents a project in Braintrust.