Launch Week 3: Five days of launches

Commits

Overview

The Confident AI SDK exposes every Commit method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.

Methods

List Commits

Lists the commits of the prompt, newest first. Pass branch to list only the commits reachable from that branch.

from confident_ai import ConfidentAI

client = ConfidentAI()

prompt = client.prompt(prompt_id="<PROMPT-ID>")
result = prompt.list_commits(branch="main")

For async mode, call a_list_commits and await it as shown below:

result = await prompt.a_list_commits(...)

Parameters

ParameterTypeDescription
branchOptional[str]The name of the branch to read from. Defaults to main when omitted.

Returns

This method returns an object of type PromptCommitList.

Methods (Stateless)

These methods take every argument themselves, so a caller reaches them through client.prompts without opening a Prompt first.

Get Commits

Lists the commits of the prompt, newest first. Pass branch to list only the commits reachable from that branch.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.prompts.get_commits(prompt_id="<PROMPT-ID>", branch="main")

For async mode, call a_get_commits and await it as shown below:

result = await client.prompts.a_get_commits(...)

Parameters

ParameterTypeDescription
prompt_idstrRequired. The unique id of the prompt.
branchOptional[str]The name of the branch to read from. Defaults to main when omitted.

Returns

This method returns an object of type PromptCommitList.

Types

PromptCommit

class PromptCommit:
    id: str
    hash: str
    message: str

idstrRequired

The id of a commit generated by Confident AI, not to be confused with the prompt id or the commit hash.

Example: "<COMMIT-ID>"

hashstrRequired

The hash of a commit generated by Confident AI.

Example: "bab04ce"

messagestrRequired

The message associated with a commit, not to be confused with a prompt's messages.

Example: "Committed from API"

PromptCommitList

class PromptCommitList:
    commits: List[PromptCommit]

commitsList[PromptCommit]Required

This is the list of commits on the prompt, newest first.

See PromptCommit.

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI