Annotations
Reference for client.annotations in the Future AGI Python and TypeScript SDKs: annotations.bulk_create, annotations.labels.create, annotations.labels.delete, annotations.labels.get, annotations.labels.list.
client.annotations on fi.Client (Python) and client.annotations on Client from @future-agi/sdk (TypeScript), with the nested resources client.annotations.labels. The models these methods return are on Annotation response models; how arguments, pagination, errors and strict mode work is in the overview.
Methods
| Method | Description |
|---|---|
annotations.bulk_create | Create or update annotations and notes on spans in bulk. |
annotations.labels.create | Create an annotation label (text, label, score, …) with its settings. |
annotations.labels.delete | Delete (archive) an annotation label. |
annotations.labels.get | Return an annotation label by id. |
annotations.labels.list | List annotation labels, optionally filtered by project, type or search text. |
client.annotations
annotations.bulk_create
Create or update annotations and notes on spans in bulk.
/tracer/bulk-annotation/ result = client.annotations.bulk_create(records=[])const result = await client.annotations.bulkCreate({ records: [] }); Signature
client.annotations.bulk_create(
*,
records: list[dict[str, Any]],
extra_query: dict[str, Any] | None = None,
extra_body: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> models.BulkAnnotationResponseResultclient.annotations.bulkCreate(params: AnnotationsBulkCreateParams, options?: RequestOptions): Promise<models.BulkAnnotationResponseResult>
export interface AnnotationsBulkCreateParams {
records: Array<Record<string, unknown>>;
} Parameters
Returns
client.annotations.labels
TypeScript: client.annotations.labels.
annotations.labels.create
Create an annotation label (text, label, score, …) with its settings.
/model-hub/annotations-labels/ result = client.annotations.labels.create(name="your-name", type="text")const result = await client.annotations.labels.create({
name: "your-name",
type: "text",
}); Signature
client.annotations.labels.create(
*,
name: str,
type: Literal['text', 'numeric', 'categorical', 'star', 'thumbs_up_down'],
settings: dict[str, Any] | None | NotGiven = NOT_GIVEN,
project: str | None | NotGiven = NOT_GIVEN,
description: str | None | NotGiven = NOT_GIVEN,
allow_notes: bool | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
extra_body: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> models.AnnotationsLabelsclient.annotations.labels.create(params: AnnotationsLabelsCreateParams, options?: RequestOptions): Promise<models.AnnotationsLabels>
export interface AnnotationsLabelsCreateParams {
name: string;
type: "text" | "numeric" | "categorical" | "star" | "thumbs_up_down";
settings?: Record<string, unknown> | null;
project?: string | null;
description?: string | null;
allow_notes?: boolean | null;
} Parameters
textnumericcategoricalstarthumbs_up_down Returns
annotations.labels.delete
Delete (archive) an annotation label.
/model-hub/annotations-labels/{id}/ result = client.annotations.labels.delete("your-id")const result = await client.annotations.labels.delete("your-id"); Signature
client.annotations.labels.delete(
id: str,
*,
extra_query: dict[str, Any] | None = None,
extra_body: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> Anyclient.annotations.labels.delete(id: string, options?: RequestOptions): Promise<unknown> Parameters
Positional argument id.
Returns
The decoded response. The contract does not describe its shape, so it is untyped.
annotations.labels.get
Return an annotation label by id.
/model-hub/annotations-labels/{id}/ result = client.annotations.labels.get("your-id")const result = await client.annotations.labels.get("your-id"); Signature
client.annotations.labels.get(
id: str,
*,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> models.AnnotationsLabelsclient.annotations.labels.get(id: string, options?: RequestOptions): Promise<models.AnnotationsLabels> Parameters
Positional argument id.
Returns
annotations.labels.list
List annotation labels, optionally filtered by project, type or search text.
/model-hub/annotations-labels/ Paginated: returns a pager (how pagination works)
for item in client.annotations.labels.list():
print(item)for await (const item of client.annotations.labels.list()) {
console.log(item);
} Signature
client.annotations.labels.list(
*,
limit: int | None | NotGiven = NOT_GIVEN,
dataset: str | None | NotGiven = NOT_GIVEN,
project_id: str | None | NotGiven = NOT_GIVEN,
type: Literal['text', 'numeric', 'categorical', 'star', 'thumbs_up_down'] | None | NotGiven = NOT_GIVEN,
search: str | None | NotGiven = NOT_GIVEN,
include_usage_count: bool | None | NotGiven = NOT_GIVEN,
include_archived: bool | None | NotGiven = NOT_GIVEN,
archived: bool | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> SyncPager[models.AnnotationsLabels]client.annotations.labels.list(params: AnnotationsLabelsListParams = {}, options?: RequestOptions): Pager<models.AnnotationsLabels>
export interface AnnotationsLabelsListParams {
/** Number of results to return per page. */
limit?: number | null;
dataset?: string | null;
project_id?: string | null;
type?: "text" | "numeric" | "categorical" | "star" | "thumbs_up_down" | null;
search?: string | null;
include_usage_count?: boolean | null;
include_archived?: boolean | null;
archived?: boolean | null;
} Parameters
Number of results to return per page.
textnumericcategoricalstarthumbs_up_down The pager sends page itself; pass limit to change the page size.
Returns
A pager of AnnotationsLabels items: iterate it, or call to_list() (Python) / toArray() (TypeScript).
Questions & Discussion