mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-25 21:36:52 +08:00
* docs(docs): start implementing docs website * update video url * add autogenerated codebase docs for backend * precommit * update links * fix config and video * gh actions * rename * workdirs * path * path * fix doc1 * redo markdown * docs * change main folder name * simplify readme * add back architecture * Fix lint errors * lint * update poetry lock --------- Co-authored-by: Jim Su <jimsu@protonmail.com>
1.9 KiB
1.9 KiB
sidebar_label, title
| sidebar_label | title |
|---|---|
| llm | opendevin.llm.llm |
LLM Objects
class LLM()
The LLM class represents a Language Model instance.
__init__
def __init__(model=DEFAULT_MODEL_NAME,
api_key=DEFAULT_API_KEY,
base_url=DEFAULT_BASE_URL,
api_version=DEFAULT_API_VERSION,
num_retries=LLM_NUM_RETRIES,
retry_min_wait=LLM_RETRY_MIN_WAIT,
retry_max_wait=LLM_RETRY_MAX_WAIT,
llm_timeout=LLM_TIMEOUT,
llm_max_return_tokens=LLM_MAX_RETURN_TOKENS)
Arguments:
modelstr, optional - The name of the language model. Defaults to LLM_MODEL.api_keystr, optional - The API key for accessing the language model. Defaults to LLM_API_KEY.base_urlstr, optional - The base URL for the language model API. Defaults to LLM_BASE_URL. Not necessary for OpenAI.api_versionstr, optional - The version of the API to use. Defaults to LLM_API_VERSION. Not necessary for OpenAI.num_retriesint, optional - The number of retries for API calls. Defaults to LLM_NUM_RETRIES.retry_min_waitint, optional - The minimum time to wait between retries in seconds. Defaults to LLM_RETRY_MIN_TIME.retry_max_waitint, optional - The maximum time to wait between retries in seconds. Defaults to LLM_RETRY_MAX_TIME.llm_timeoutint, optional - The maximum time to wait for a response in seconds. Defaults to LLM_TIMEOUT.llm_max_return_tokensint, optional - The maximum number of tokens to return. Defaults to LLM_MAX_RETURN_TOKENS.
Attributes:
model_namestr - The name of the language model.api_keystr - The API key for accessing the language model.base_urlstr - The base URL for the language model API.api_versionstr - The version of the API to use.
completion
@property
def completion()
Decorator for the litellm completion function.