Module: Rasti::AI
- Extended by:
- ClassConfig, MultiRequire
- Defined in:
- lib/rasti/ai.rb,
lib/rasti/ai/tool.rb,
lib/rasti/ai/roles.rb,
lib/rasti/ai/usage.rb,
lib/rasti/ai/client.rb,
lib/rasti/ai/errors.rb,
lib/rasti/ai/result.rb,
lib/rasti/ai/version.rb,
lib/rasti/ai/provider.rb,
lib/rasti/ai/assistant.rb,
lib/rasti/ai/mcp/client.rb,
lib/rasti/ai/mcp/server.rb,
lib/rasti/ai/gemini/roles.rb,
lib/rasti/ai/gemini/client.rb,
lib/rasti/ai/mcp/constants.rb,
lib/rasti/ai/open_ai/roles.rb,
lib/rasti/ai/open_ai/client.rb,
lib/rasti/ai/provider_aware.rb,
lib/rasti/ai/anthropic/roles.rb,
lib/rasti/ai/assistant_state.rb,
lib/rasti/ai/gemini/provider.rb,
lib/rasti/ai/tool_serializer.rb,
lib/rasti/ai/anthropic/client.rb,
lib/rasti/ai/gemini/assistant.rb,
lib/rasti/ai/open_ai/provider.rb,
lib/rasti/ai/huawei_maas/roles.rb,
lib/rasti/ai/open_ai/assistant.rb,
lib/rasti/ai/open_router/roles.rb,
lib/rasti/ai/anthropic/provider.rb,
lib/rasti/ai/huawei_maas/client.rb,
lib/rasti/ai/mcp/tools_registry.rb,
lib/rasti/ai/open_router/client.rb,
lib/rasti/ai/anthropic/assistant.rb,
lib/rasti/ai/huawei_maas/provider.rb,
lib/rasti/ai/open_router/provider.rb,
lib/rasti/ai/huawei_maas/assistant.rb,
lib/rasti/ai/open_router/assistant.rb
Defined Under Namespace
Modules: Anthropic, Errors, Gemini, HuaweiMaaS, MCP, OpenAI, OpenRouter, ProviderAware, Roles Classes: Assistant, AssistantState, Client, Provider, Result, Tool, ToolSerializer, Usage
Constant Summary collapse
- VERSION =
'3.2.0'
Class Method Summary collapse
- .create_assistant(provider: nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil, state: nil, system: nil, tools: [], mcp_servers: {}, json_schema: nil, thinking: nil, client: nil) ⇒ Object
- .generate_text(provider: nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil, prompt: nil, messages: nil, system: nil, json_schema: nil, thinking: nil, client: nil) ⇒ Object
- .provider(name = nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil) ⇒ Object
Class Method Details
.create_assistant(provider: nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil, state: nil, system: nil, tools: [], mcp_servers: {}, json_schema: nil, thinking: nil, client: nil) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rasti/ai.rb', line 67 def create_assistant(provider:nil, model:nil, api_key:nil, usage_tracker:nil, logger:nil, http_connect_timeout:nil, http_read_timeout:nil, http_max_retries:nil, state:nil, system:nil, tools:[], mcp_servers:{}, json_schema:nil, thinking:nil, client:nil) resolved_provider, resolved_model = build_provider( provider, model, api_key, usage_tracker, logger, http_connect_timeout, http_read_timeout, http_max_retries ) resolved_provider.create_assistant( model: resolved_model, state: state, system: system, tools: tools, mcp_servers: mcp_servers, json_schema: json_schema, thinking: thinking, client: client ) end |
.generate_text(provider: nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil, prompt: nil, messages: nil, system: nil, json_schema: nil, thinking: nil, client: nil) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/rasti/ai.rb', line 89 def generate_text(provider:nil, model:nil, api_key:nil, usage_tracker:nil, logger:nil, http_connect_timeout:nil, http_read_timeout:nil, http_max_retries:nil, prompt:nil, messages:nil, system:nil, json_schema:nil, thinking:nil, client:nil) resolved_provider, resolved_model = build_provider( provider, model, api_key, usage_tracker, logger, http_connect_timeout, http_read_timeout, http_max_retries ) resolved_provider.generate_text( model: resolved_model, prompt: prompt, messages: , system: system, json_schema: json_schema, thinking: thinking, client: client ) end |
.provider(name = nil, model: nil, api_key: nil, usage_tracker: nil, logger: nil, http_connect_timeout: nil, http_read_timeout: nil, http_max_retries: nil) ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/rasti/ai.rb', line 58 def provider(name=nil, model:nil, api_key:nil, usage_tracker:nil, logger:nil, http_connect_timeout:nil, http_read_timeout:nil, http_max_retries:nil) build_provider( name, model, api_key, usage_tracker, logger, http_connect_timeout, http_read_timeout, http_max_retries ).first end |