lwe.plugins Package¶
lwe.plugins Submodules¶
lwe.plugins.echo module¶
- class lwe.plugins.echo.Echo(config=None, cache_manager=None)[source]¶
Bases:
PluginSimple echo plugin, echos back the text you give it
- command_echo(arg)[source]¶
Echo command, a simple plugin example
This command is provided as an example of extending functionality via a plugin.
- Arguments:
text: The text to echo
- Examples:
{COMMAND} one
lwe.plugins.examples module¶
- class lwe.plugins.examples.Examples(config=None, cache_manager=None)[source]¶
Bases:
PluginEasily install example configuration files
- command_examples(arg)[source]¶
List or install example files
The example files that come with the package can be listed and optionally installed in the currently running profile configuration.
- Arguments:
list: List all example files, and where they will be installed. type: The type of example files to install (default is all configured types).
- Examples:
{COMMAND} list {COMMAND} presets
lwe.plugins.provider_chat_openai module¶
- class lwe.plugins.provider_chat_openai.CustomChatOpenAI(*args: ~typing.Any, name: str | None = None, cache: ~langchain_core.caches.BaseCache | bool | None = None, verbose: bool = <factory>, callbacks: list[~langchain_core.callbacks.base.BaseCallbackHandler] | ~langchain_core.callbacks.base.BaseCallbackManager | None = None, tags: list[str] | None = None, metadata: dict[str, ~typing.Any] | None = None, custom_get_token_ids: ~typing.Callable[[str], list[int]] | None = None, callback_manager: ~langchain_core.callbacks.base.BaseCallbackManager | None = None, rate_limiter: ~langchain_core.rate_limiters.BaseRateLimiter | None = None, disable_streaming: bool | ~typing.Literal['tool_calling'] = False, client: ~typing.Any = None, async_client: ~typing.Any = None, root_client: ~typing.Any = None, root_async_client: ~typing.Any = None, model: str = 'gpt-3.5-turbo', temperature: float | None = None, model_kwargs: dict[str, ~typing.Any] = <factory>, api_key: ~pydantic.types.SecretStr | None = <factory>, base_url: str | None = None, organization: str | None = None, openai_proxy: str | None = <factory>, timeout: float | tuple[float, float] | ~typing.Any | None = None, stream_usage: bool | None = None, max_retries: int | None = None, presence_penalty: float | None = None, frequency_penalty: float | None = None, seed: int | None = None, logprobs: bool | None = None, top_logprobs: int | None = None, logit_bias: dict[int, int] | None = None, streaming: bool = False, n: int | None = None, top_p: float | None = None, max_completion_tokens: int | None = None, reasoning_effort: str | None = None, reasoning: dict[str, ~typing.Any] | None = None, verbosity: str | None = None, tiktoken_model_name: str | None = None, default_headers: ~collections.abc.Mapping[str, str] | None = None, default_query: ~collections.abc.Mapping[str, object] | None = None, http_client: ~typing.Any | None = None, http_async_client: ~typing.Any | None = None, stop_sequences: list[str] | str | None = None, extra_body: ~collections.abc.Mapping[str, ~typing.Any] | None = None, include_response_headers: bool = False, disabled_params: dict[str, ~typing.Any] | None = None, include: list[str] | None = None, service_tier: str | None = None, store: bool | None = None, truncation: str | None = None, use_previous_response_id: bool = False, use_responses_api: bool | None = None, output_version: ~typing.Literal['v0', 'responses/v1'] = 'v0')[source]¶
Bases:
ChatOpenAI- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'protected_namespaces': (), 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lwe.plugins.provider_chat_openai.ProviderChatOpenai(config=None, cache_manager=None)[source]¶
Bases:
ProviderAccess to OpenAI chat models via the OpenAI API
- property capabilities¶
- property default_model¶
- handle_streaming_chunk(chunk: AIMessageChunk | str, _previous_chunks: list[AIMessageChunk | str]) str[source]¶
- property static_models¶
lwe.plugins.provider_fake_llm module¶
- class lwe.plugins.provider_fake_llm.CustomFakeMessagesListChatModel(*, name: str | None = None, cache: ~langchain_core.caches.BaseCache | bool | None = None, verbose: bool = <factory>, callbacks: list[~langchain_core.callbacks.base.BaseCallbackHandler] | ~langchain_core.callbacks.base.BaseCallbackManager | None = None, tags: list[str] | None = None, metadata: dict[str, ~typing.Any] | None = None, custom_get_token_ids: ~typing.Callable[[str], list[int]] | None = None, callback_manager: ~langchain_core.callbacks.base.BaseCallbackManager | None = None, rate_limiter: ~langchain_core.rate_limiters.BaseRateLimiter | None = None, disable_streaming: bool | ~typing.Literal['tool_calling'] = False, responses: ~typing.List[~langchain_core.messages.base.BaseMessage | ~langchain_core.messages.base.BaseMessageChunk | str] | ~typing.List[~typing.List[~langchain_core.messages.base.BaseMessage | ~langchain_core.messages.base.BaseMessageChunk | str]], sleep: float | None = None, i: int = 0, model_name: str)[source]¶
Bases:
FakeMessagesListChatModel- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'protected_namespaces': ()}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_name: str¶
- class lwe.plugins.provider_fake_llm.FakeMessagesListChatModel(*args: ~typing.Any, name: str | None = None, cache: ~langchain_core.caches.BaseCache | bool | None = None, verbose: bool = <factory>, callbacks: list[~langchain_core.callbacks.base.BaseCallbackHandler] | ~langchain_core.callbacks.base.BaseCallbackManager | None = None, tags: list[str] | None = None, metadata: dict[str, ~typing.Any] | None = None, custom_get_token_ids: ~typing.Callable[[str], list[int]] | None = None, callback_manager: ~langchain_core.callbacks.base.BaseCallbackManager | None = None, rate_limiter: ~langchain_core.rate_limiters.BaseRateLimiter | None = None, disable_streaming: bool | ~typing.Literal['tool_calling'] = False, responses: ~typing.List[~langchain_core.messages.base.BaseMessage | ~langchain_core.messages.base.BaseMessageChunk | str] | ~typing.List[~typing.List[~langchain_core.messages.base.BaseMessage | ~langchain_core.messages.base.BaseMessageChunk | str]], sleep: float | None = None, i: int = 0)[source]¶
Bases:
BaseChatModelFake ChatModel for testing purposes.
- i: int¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'protected_namespaces': ()}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- responses: List[BaseMessage | BaseMessageChunk | str] | List[List[BaseMessage | BaseMessageChunk | str]]¶
- sleep: float | None¶