API Reference
chat_history
get_shell_history(count)
Return the last count commands from the current shell's history file.
Source code in cli/chat_history.py
history_file()
Path to the current shell's history file.
Source code in cli/chat_history.py
config_manager
Configuration manager for AI models.
ConfigurationManager
Manages model configurations stored in JSON.
Source code in cli/config_manager.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
get_model_config(model_name)
get_selected_model()
list_models()
remove_model(model_name)
Remove a model from configuration.
Source code in cli/config_manager.py
set_model_config(model_name, provider, api_key, temperature=0.7, max_tokens=None)
Set or update configuration for a model.
Source code in cli/config_manager.py
set_selected_model(model_name)
Set the active model.
Source code in cli/config_manager.py
llm
LLM interaction module.
generate_response(prompt, llm_service, history)
Generate and display AI response.
Source code in cli/llm.py
llm_service
Service for LLM generation and orchestration.
LLMService
Service for generating LLM responses.
Source code in cli/llm_service.py
__init__(config_manager=None)
Initialize LLM service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_manager
|
Optional[ConfigurationManager]
|
Configuration manager instance |
None
|
Source code in cli/llm_service.py
generate(prompt, model_name=None, show_spinner=True, **kwargs)
Generate response from LLM.
Source code in cli/llm_service.py
models
Models package for LLM abstraction layer. Provides interfaces and implementations for different LLM providers.
ILLMProvider
Bases: ABC
Interface for LLM providers.
Source code in cli/models/base.py
generate(prompt, **kwargs)
abstractmethod
get_provider_name()
abstractmethod
LLMProviderFactory
Factory for creating LLM provider instances.
Source code in cli/models/factory.py
create(config)
classmethod
Create an LLM provider instance based on configuration.
Source code in cli/models/factory.py
ModelConfig
dataclass
anthropic_provider
Anthropic Claude provider implementation using LangChain.
AnthropicProvider
Bases: BaseLLMProvider
Anthropic Claude LLM provider.
Source code in cli/models/anthropic_provider.py
base
Base interfaces and abstractions for LLM providers.
ILLMProvider
Bases: ABC
Interface for LLM providers.
Source code in cli/models/base.py
generate(prompt, **kwargs)
abstractmethod
get_provider_name()
abstractmethod
base_provider
Base provider implementation with common functionality.
BaseLLMProvider
Bases: ILLMProvider
Base implementation for LLM providers.
Source code in cli/models/base_provider.py
generate(prompt, **kwargs)
Generate response from LLM.
Source code in cli/models/base_provider.py
validate_config()
Validate configuration.
Source code in cli/models/base_provider.py
load_backend(module, name, extra)
Import an optional provider backend, or say how to install it.
Source code in cli/models/base_provider.py
factory
Factory for creating LLM provider instances.
LLMProviderFactory
Factory for creating LLM provider instances.
Source code in cli/models/factory.py
create(config)
classmethod
Create an LLM provider instance based on configuration.
Source code in cli/models/factory.py
gemini_provider
Google Gemini provider implementation using LangChain.
GeminiProvider
Bases: BaseLLMProvider
Google Gemini LLM provider.
Source code in cli/models/gemini_provider.py
openai_provider
OpenAI provider implementation using LangChain.
OpenAIProvider
Bases: BaseLLMProvider
OpenAI LLM provider.
Source code in cli/models/openai_provider.py
prompt
CLI entry point for Vertex-CLI.
main()
Report failures as messages instead of tracebacks.
Source code in cli/prompt.py
utils
install_requirements()
Install the dependencies declared in pyproject.toml.
prettify_llm_output(response)
Prettify LLM output using Rich markdown.
Source code in cli/utils.py
spin_loader(stop_event)
Display a spinning loader.