Skip to content

Add docstrings for _models/completions#124

Merged
vhaldemar merged 24 commits intoyandex-cloud:masterfrom
Mandzhi:new-branch-7
Jul 16, 2025
Merged

Add docstrings for _models/completions#124
vhaldemar merged 24 commits intoyandex-cloud:masterfrom
Mandzhi:new-branch-7

Conversation

@Mandzhi
Copy link
Copy Markdown
Collaborator

@Mandzhi Mandzhi commented Jul 12, 2025

No description provided.


class BaseCompletions(BaseModelFunction[ModelTypeT]):
"""
A class for handling model completions.
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.

completioins models, наверное

model_version: str = 'latest',
) -> ModelTypeT:
"""
Call the specified model to generate completions.
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.

Не, это не вызов модели, а создание объекта модели для вызова


:param model_type: the type of langchain model to initialize.
Defaults to "chat".
:param timeout: the timeout, or the maximum time to wait for the request to complete in seconds.
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.

Тут немного другой таймаут.
Он задает дефолт для объекта модели лангчейна.

"""
Configures the model with specified parameters.

:param temperature: a sampling temperature to use - higher values mean more random results.
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.

И тут про область значений ничего не сказано.
ЕМНИП она лежит в [0;1]

"""
Executes the model with the provided messages.

:param messages: the input messages to process.
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.

Надо бы слова добавить про то, какими бывают сообщения.
Их типы.
Там может быть строчка, словарик, объект результата, например, но там оч много подробностей

) -> AsyncIterator[GPTModelResult[AsyncToolCall]]:
"""
Executes the model with the provided messages
and yields results as they become available.
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.

Тут нужно как-то перефразировать, не результаты, а partial results

"""
A class representing detailed usage statistics for a completion request,
including reasoning tokens.
Inherits from :func:`.Usage` and includes additional information about reasoning tokens.
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.

не :func:, а :class:, но нужно проверить, что реф будет работать


@dataclass(frozen=True)
class Alternative(TextMessage, ProtoBased[ProtoAlternative], HaveToolCalls[ToolCallTypeT]):
"""A class representing an alternative response, including its status and tool calls."""
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.

Мне не нравится, суть в не в том, что это альтернатива ответу, а в том, что это одна из альтернатив ответа.
Слово "альтернатива" вводит в заблуждение.

response: {alternative1, alternative2},
Причем сейчас у ответа всегда одна и только одна альтернатива.

Executes the model with the provided messages.

:param messages: the input messages to process. Could be a string, a dictionary, or a result object.
Read more about other possible message types in the `documentation <https://yandex.cloud/docs/foundation-models/text-generation/api-ref/TextGeneration/completion#yandex.cloud.ai.foundation_models.v1.Message>`_.
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.

Ссылка точно не та, прото точно никому не нужен.

Вот тут вот есть что-то приличное:
https://yandex.cloud/ru/docs/foundation-models/sdk/#usage

@vhaldemar vhaldemar merged commit 54e9aad into yandex-cloud:master Jul 16, 2025
11 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