> ## Documentation Index
> Fetch the complete documentation index at: https://agent-observability-docs.splunk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# project

## Project

Object-centric interface for Splunk AO projects.

This class provides an intuitive way to work with Splunk AO projects,
encapsulating project management operations and providing seamless
integration with log stream management.

**Examples**

# Create a new project locally, then persist

project = Project(name="My AI Project").create()

# Get an existing project

project = Project.get(name="My AI Project")

# List all projects

projects = Project.list()

# Create a log stream for the project

agent\_stream = project.create\_agent\_stream(name="Production Logs")

# List log streams for the project

log\_streams = project.list\_agent\_streams()

# Access related resources via properties

for stream in project.agent\_streams:
print(stream.name)

for experiment in project.experiments:
print(experiment.name)

for dataset in project.datasets:
print(dataset.name)

for prompt in project.prompts:
print(prompt.name)

# Or use the explicit list methods

datasets = project.list\_datasets()
prompts = project.list\_prompts()

# Manage collaborators

for collab in project.collaborators:
print(f"\{collab.email}: \{collab.role}")

# Add a collaborator

project.add\_collaborator(user\_id="user-123", role=CollaboratorRole.EDITOR)

# Update a collaborator's role

project.update\_collaborator(user\_id="user-123", role=CollaboratorRole.VIEWER)

# Remove a collaborator

project.remove\_collaborator(user\_id="user-123")

# Delete a project (WARNING: cannot be undone!)

old\_project = Project.get(name="Old Project")
old\_project.delete()

### add\_collaborator

```python theme={null}
def add_collaborator(self,
                     user_id: str,
                     role: CollaboratorRole=CollaboratorRole.VIEWER) -> Collaborator
```

Add a collaborator to this project.

Shares the project with a user, granting them access with the specified role.

**Arguments**

* `user_id`: The ID of the user to add as a collaborator.
* `role`: The role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR.
  Defaults to VIEWER.

### agent\_streams

```python theme={null}
def agent_streams(self) -> 'builtins.list[AgentStream]'
```

Property to access agent streams for this project.

This is a read-only property that returns the current list of agent streams.
To create new agent streams, use :meth:`create_agent_stream`.

**Examples**

project = Project.get(name="My AI Project")
for stream in project.agent\_streams:
print(stream.name)

### collaborators

```python theme={null}
def collaborators(self) -> builtins.list[Collaborator]
```

Property to access collaborators for this project.

Returns users who have access to this project. Each Collaborator object
has update() and remove() methods for modifying access. You can also
use add\_collaborator() on the project to add new collaborators.

.. note

```python theme={null}
**This property makes an API call on every access and is not cached.**
```

**Examples**

project = Project.get(name="My AI Project")
for collab in project.collaborators:
print(f"\{collab.email}: \{collab.role}")

# Filter by role

editors = \[c for c in project.collaborators if c.role == CollaboratorRole.EDITOR]

# Update or remove directly on the collaborator object

collab.update(role=CollaboratorRole.EDITOR)
collab.remove()

### create

```python theme={null}
def create(self) -> Project
```

Persist this project to the API.

**Examples**

project = Project(name="My AI Project").create()
assert project.is\_synced()

### create\_agent\_stream

```python theme={null}
def create_agent_stream(self, name: str) -> 'AgentStream'
```

Create a new agent stream for this project.

**Arguments**

* `name` (`str`): The name of the agent stream to create.

### datasets

```python theme={null}
def datasets(self) -> builtins.list[Dataset]
```

Property to access datasets used in this project.

This is a read-only property that returns the datasets associated with this project.

**Examples**

project = Project.get(name="My AI Project")
for dataset in project.datasets:
print(dataset.name)

### delete

```python theme={null}
def delete(self) -> None
```

Delete this project.

This is a destructive operation that permanently removes the project
and all associated data (experiments, log streams, datasets, traces, etc.)
from the API.

WARNING: This operation cannot be undone!

After successful deletion, the object state is set to DELETED. The local
object still exists in memory but no longer represents a remote resource.

**Examples**

# Delete a project

project = Project.get(name="Old Project")
project.delete()
assert project.is\_deleted()

# After deletion, the project no longer exists remotely

# The local object is marked as DELETED

print(project.sync\_state)  # SyncState.DELETED

### experiments

```python theme={null}
def experiments(self) -> builtins.list[Experiment]
```

Property to access experiments for this project.

This is a read-only property that returns the current list of experiments.

**Examples**

project = Project.get(name="My AI Project")
for exp in project.experiments:
print(exp.name)

### get

```python theme={null}
def get(cls, *, id: str | None=None, name: str | None=None) -> Project | None
```

Get an existing project by ID or name.

**Arguments**

* `id` (`Optional[str]`): The project ID.
* `name` (`Optional[str]`): The project name.

### list

```python theme={null}
def list(cls) -> builtins.list[Project]
```

List all available projects.

**Examples**

projects = Project.list()
for project in projects:

# Process each project

pass

### list\_agent\_streams

```python theme={null}
def list_agent_streams(self,
                       *,
                       limit: Unset | int=100,
                       starting_token: Unset | int=0) -> 'builtins.list[AgentStream]'
```

List agent streams for this project.

Returns a single page of results. Use `starting_token` (from
`next_starting_token` on a prior response) to fetch subsequent pages.

**Arguments**

* `limit` (`Union[Unset, int]`): Maximum number of agent streams per page. Defaults to 100.
* `starting_token` (`Union[Unset, int]`): Pagination token. Defaults to 0 (first page).

### list\_collaborators

```python theme={null}
def list_collaborators(self) -> builtins.list[Collaborator]
```

List all collaborators for this project.

Returns a list of Collaborator objects representing users who have
access to this project, along with their roles and permissions.

**Examples**

project = Project.get(name="My AI Project")
collaborators = project.list\_collaborators()
for collab in collaborators:
print(f"\{collab.email}: \{collab.role}")

### list\_datasets

```python theme={null}
def list_datasets(self) -> builtins.list[Dataset]
```

List all datasets used in this project.

**Examples**

project = Project.get(name="My AI Project")
datasets = project.list\_datasets()
for dataset in datasets:

# Process each dataset

pass

### list\_experiments

```python theme={null}
def list_experiments(self) -> builtins.list[Experiment]
```

List all experiments for this project.

**Examples**

project = Project.get(name="My AI Project")
experiments = project.list\_experiments()
for exp in experiments:

# Process each experiment

pass

### list\_prompts

```python theme={null}
def list_prompts(self) -> builtins.list[Prompt]
```

List all prompts used in this project.

**Examples**

project = Project.get(name="My AI Project")
prompts = project.list\_prompts()
for prompt in prompts:

# Process each prompt

pass

### prompts

```python theme={null}
def prompts(self) -> builtins.list[Prompt]
```

Property to access prompts used in this project.

This is a read-only property that returns the prompts associated with this project.

**Examples**

project = Project.get(name="My AI Project")
for prompt in project.prompts:
print(prompt.name)

### refresh

```python theme={null}
def refresh(self) -> None
```

Refresh this project's state from the API.

Updates all attributes with the latest values from the remote API
and sets the state to SYNCED.

**Examples**

project.refresh()
assert project.is\_synced()

### remove\_collaborator

```python theme={null}
def remove_collaborator(self, user_id: str) -> None
```

Remove a collaborator from this project.

Revokes a user's access to this project. The user will no longer be able
to view or interact with the project.

**Arguments**

* `user_id`: The ID of the user to remove.

### save

```python theme={null}
def save(self) -> Project
```

Save changes to this project.

Persists any local changes to the remote API. If the project
is LOCAL\_ONLY, delegates to create(). If SYNCED, returns immediately as a
no-op. Raises ValueError for DELETED or FAILED\_SYNC states.

.. note

```python theme={null}
``ProjectUpdate`` also supports ``description`` and ``labels``, but these
are not exposed as tracked attributes on the domain object because the read
endpoints (get/list) do not return them consistently.

If the project is in FAILED_SYNC state (from a prior failed operation), this
method raises ValueError. Call :meth:`refresh` first to re-sync, then retry.
```

**Examples**

# Create a new project

project = Project(name="My Project")
project.save()

# Update an existing project's name via dirty-tracking

project = Project.get(name="My Project")
project.name = "Renamed Project"  # automatically marks DIRTY
project.save()

### update\_collaborator

```python theme={null}
def update_collaborator(self, user_id: str, role: CollaboratorRole) -> Collaborator
```

Update a collaborator's role on this project.

Changes the role of an existing collaborator. The user must already
have access to the project.

**Arguments**

* `user_id`: The ID of the user whose role to update.
* `role`: The new role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR.
