Documentation
¶
Overview ¶
Package projects provides operations for managing Braintrust projects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API provides operations for managing Braintrust projects.
func (*API) Create ¶
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",
})
func (*API) Delete ¶
Delete deletes a project by ID.
Example:
err := client.Projects().Delete(ctx, "proj_123")
func (*API) Get ¶
Get retrieves a project by ID.
Example:
project, err := client.Projects().Get(ctx, "proj_123")
func (*API) List ¶
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,
})
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.