Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion camel/memories/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ def to_openai_message(self) -> OpenAIMessage:


class ContextRecord(BaseModel):
r"""The result of memory retrieving."""
r"""The result of memory retrieving.

Args:
memory_record (MemoryRecord): The retrieved record.
score (float): Relevance score from the retrieval.
"""

memory_record: MemoryRecord
score: float
Expand Down
8 changes: 8 additions & 0 deletions camel/models/base_audio_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
class BaseAudioModel(ABC):
r"""Base class for audio models providing Text-to-Speech (TTS) and
Speech-to-Text (STT) functionality.

Args:
api_key (Optional[str], optional): API key for the service.
(default: :obj:`None`)
url (Optional[str], optional): Base URL for the API.
(default: :obj:`None`)
timeout (Optional[float], optional): Request timeout in
seconds. (default: :obj:`Constants.TIMEOUT_THRESHOLD`)
"""

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion camel/models/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ModelManager:
model backend or list of model backends
(e.g., model instances, APIs)
scheduling_strategy (str): name of function that defines how
to select the next model. (default: :str:`round_robin`)
to select the next model. (default: :obj:`round_robin`)
"""

def __init__(
Expand Down
12 changes: 11 additions & 1 deletion camel/models/openai_audio_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@

class OpenAIAudioModels(BaseAudioModel):
r"""Provides access to OpenAI's Text-to-Speech (TTS) and Speech_to_Text
(STT) models."""
(STT) models.

Args:
api_key (Optional[str], optional): OpenAI API key.
Falls back to :obj:`OPENAI_API_KEY` env var.
(default: :obj:`None`)
url (Optional[str], optional): Base URL override.
(default: :obj:`None`)
timeout (Optional[float], optional): Request timeout.
(default: :obj:`None`)
"""

def __init__(
self,
Expand Down
17 changes: 16 additions & 1 deletion camel/models/stub_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@


class StubTokenCounter(BaseTokenCounter):
r"""Simple token counter that returns a constant value."""

def count_tokens_from_messages(self, messages: List[OpenAIMessage]) -> int:
r"""Token counting for STUB models, directly returning a constant.

Expand Down Expand Up @@ -71,7 +73,20 @@ def decode(self, token_ids: List[int]) -> str:


class StubModel(BaseModelBackend):
r"""A dummy model used for unit tests."""
r"""A dummy model used for unit tests.

Args:
model_type (Union[ModelType, str]): Model type identifier.
model_config_dict (Optional[Dict[str, Any]], optional):
Configuration dict. (default: :obj:`None`)
api_key (Optional[str], optional): API key (unused).
(default: :obj:`None`)
url (Optional[str], optional): URL (unused).
(default: :obj:`None`)
token_counter (Optional[BaseTokenCounter], optional):
Token counter instance.
(default: :obj:`None`)
"""

model_type = ModelType.STUB

Expand Down