Skip to content

Commit

Permalink
feat: add model comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bestony authored Jan 15, 2025
1 parent 86ca54d commit 1f1d059
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@


class StepFun(OpenAILike):
"""
The StepFun class is a subclass of OpenAILike and is used to interact with the StepFun model.
Parameters:
model (str): The name of the Stepfun model to use. See https://platform.stepfun.com/docs/llm/modeloverview for options.
context_window (int): The maximum size of the context window for the model. See https://platform.stepfun.com/docs/llm/modeloverview for options.
is_chat_model (bool): Indicates whether the model is a chat model.
Attributes:
model (str): The name of the Stepfun model to use.
context_window (int): The maximum size of the context window for the model.
is_chat_model (bool): Indicates whether the model is a chat model.
"""

model: str = Field(
description="The Stepfun model to use. See https://platform.stepfun.com/docs/llm/modeloverview for options."
Expand All @@ -40,6 +53,22 @@ def __init__(
api_key: Optional[str] = None,
**kwargs: Any,
) -> None:
"""
Initialize the OpenAI API client.
Args:
model (str): The name of the model to use. Defaults to DEFAULT_MODEL.
temperature (float): The temperature to use for the model. Defaults to DEFAULT_TEMPERATURE.
max_tokens (int): The maximum number of tokens to generate. Defaults to DEFAULT_NUM_OUTPUTS.
additional_kwargs (Optional[Dict[str, Any]]): Additional keyword arguments to pass to the model. Defaults to None.
max_retries (int): The maximum number of retries to make when calling the API. Defaults to 5.
api_base (Optional[str]): The base URL for the API. Defaults to DEFAULT_API_BASE.
api_key (Optional[str]): The API key to use. Defaults to None.
**kwargs (Any): Additional keyword arguments to pass to the model.
Returns:
None
"""
additional_kwargs = additional_kwargs or {}

api_base = get_from_param_or_env("api_base", api_base, "STEPFUN_API_BASE")
Expand All @@ -58,4 +87,4 @@ def __init__(

@classmethod
def class_name(cls) -> str:
return "Stpefun_LLM"
return "Stpefun_LLM"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-stepfun"
readme = "README.md"
version = "0.3.1"
version = "0.3.2"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
Expand Down Expand Up @@ -60,4 +60,4 @@ extras = ["toml"]
version = ">=v2.2.6"

[[tool.poetry.packages]]
include = "llama_index/"
include = "llama_index/"

0 comments on commit 1f1d059

Please sign in to comment.