Skip to content

Add docstrings for _threads#127

Merged
vhaldemar merged 15 commits intoyandex-cloud:masterfrom
Mandzhi:new-branch-8
Aug 10, 2025
Merged

Add docstrings for _threads#127
vhaldemar merged 15 commits intoyandex-cloud:masterfrom
Mandzhi:new-branch-8

Conversation

@Mandzhi
Copy link
Copy Markdown
Collaborator

@Mandzhi Mandzhi commented Jul 16, 2025

No description provided.

:param labels: a set of labels for the thread.
:param ttl_days: time-to-live in days for the thread.
:param expiration_policy: expiration policy for the file.
Assepts for passing ``static`` or ``since_last_active`` `strings <https://yandex.cloud/docs/foundation-models/threads/api-ref/Message/create#yandex.cloud.ai.common.ExpirationConfig>`_. Should be defined if ``ttl_days`` has been defined, otherwise both parameters should be undefined.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я уже отмечал, что ссылки на прото не приветствуются)
Но мне еще кажется, что эта ссылка тут в принципе не нужна - все уже сказано.



class BaseThreads(BaseDomain, Generic[ThreadTypeT]):
"""A class for managing threads in a specific domain.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

managing threads in a specific domain

Что-то не то, получается.

Threads - это "домен" с т.з. SDK, потому что доступ к ним осуществляется через sdk.threads, сами треды ни о каких доменах ничего не знают



class BaseThreads(BaseDomain, Generic[ThreadTypeT]):
"""A class for managing threads in a specific domain.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также, как всегда, стоит упомянуть, что это часть Assistants API

"""A class for managing threads in a specific domain.

This class provides methods to create, retrieve, and list threads. It acts as a foundation for
thread implementations and requires a specific thread type to be defined.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It acts as a foundation for thread implementations and requires a specific thread type to be defined.

Я до конца не понял, что именно ты хотела тут донести, но тут явно что-то не то.

) -> ThreadTypeT:
"""Retrieve a thread by its id.

This method fetches a thread using its unique identifier.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetches already created thread?

class BaseThread(ExpirableResource):
"""A class for a thread resource.

It provides methods for updating, deleting, writing to, and reading from a thread.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы хотел где-нибудь увидеть слово Message, потому что именно их содержит тред


This method allows sending a message to the thread with optional labels.

:param message: the message to be sent to the thread.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Немного побольше нужно про MessageType, что там не только строчку можно передать, но и другие типы данных, смотрите какие: ...
Мне кажется, такое уже писали в районе Комплишенсов


@dataclasses.dataclass(frozen=True)
class RichThread(BaseThread):
"""Rich representation of a thread with additional metadata.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это удалить, вроде

labels: dict[str, str] | None


@doc_from(BaseThread)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И это удалить, вроде.
Тогда в этом месте, вроде, по наследованию прилетит документация.
Можешь проверить это место в сгенерированной доке? (заодно проверишь мою инструкцию по генерации доки)

@@ -185,13 +243,14 @@ async def read(

__aiter__ = read
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можешь проверить, если описать __aiter__ с помощью #: синтаксиса, что и как пролезет (и проелезет ли вообще) в документацию?

@vhaldemar vhaldemar merged commit eee6521 into yandex-cloud:master Aug 10, 2025
12 checks passed
GBocharov pushed a commit that referenced this pull request Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants