Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
siyangqiu committed Jul 30, 2024
1 parent b07bfe6 commit bb77c1b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/v1/concepts/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ Ex: `paid-user`, `v3`, `recruiter-agent`'

# How to use Tags

Tags belong to [Sessions](/v1/concepts/tags), but can be assigned in multiple ways.
There are two types: `tags` and `default tags`.

Tags belong to [Sessions](/v1/concepts/sessions) and are a fantastic way to organize your Sessions. When a session is created, `default_tags`
are automatically assigned to the session alongside any tags that are passed in.

## On `init()`

Passing tags into the `init` function will assign these tags to the `Session`
Passing `default_tags` into the `init` function will assign these tags to the all subsequent Sessions.

<CodeGroup>
```python python
agentops.init(tags=['test tag'])
agentops.init(default_tags=['test tag'])
```
</CodeGroup>

## `set_tags([str])`

This will override any existing tags on the session and set them to the value passed into the function.
This will override any existing tags on the session and set them to the value passed into the function. Future sessions will not have these tags.

<CodeGroup>
```python python
Expand All @@ -32,7 +35,7 @@ agentops.set_tags(['test new tag'])

## `add_tags([str])`

This will append an array of tags to the Session's existing tags
This will append an array of tags to the session's existing tags. Future sessions will not have these tags.

<CodeGroup>
```python python
Expand Down

0 comments on commit bb77c1b

Please sign in to comment.