Genie Facade and Interfaces¶
Genie Facade¶
genie_tooling.genie.Genie ¶
Genie(
plugin_manager: PluginManager,
key_provider: KeyProvider,
config: MiddlewareConfig,
tool_manager: ToolManager,
tool_invoker: ToolInvoker,
rag_manager: RAGManager,
tool_lookup_service: ToolLookupService,
llm_provider_manager: LLMProviderManager,
command_processor_manager: CommandProcessorManager,
log_adapter: LogAdapter,
tracing_manager: InteractionTracingManager,
hitl_manager: HITLManager,
token_usage_manager: TokenUsageManager,
guardrail_manager: GuardrailManager,
prompt_manager: PromptManager,
conversation_manager: ConversationStateManager,
llm_output_parser_manager: LLMOutputParserManager,
task_queue_manager: DistributedTaskQueueManager,
default_embedder: Optional[EmbeddingGeneratorPlugin],
default_vector_store: Optional[VectorStorePlugin],
llm_interface: LLMInterface,
rag_interface: RAGInterface,
observability_interface: ObservabilityInterface,
hitl_interface: HITLInterface,
usage_tracking_interface: UsageTrackingInterface,
prompt_interface: PromptInterface,
conversation_interface: ConversationInterface,
task_queue_interface: TaskQueueInterface,
)
Source code in src/genie_tooling/genie.py
Functions¶
create
async
classmethod
¶
create(
config: MiddlewareConfig,
key_provider_instance: Optional[KeyProvider] = None,
plugin_manager: Optional[PluginManager] = None,
) -> Genie
Asynchronously creates and initializes the Genie facade and its components.
This is the primary entry point for creating a Genie instance. It orchestrates the discovery of plugins, resolution of configurations, and instantiation of all necessary managers and interfaces.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
MiddlewareConfig
|
The main configuration object for the middleware. |
required |
key_provider_instance
|
Optional[KeyProvider]
|
An optional, pre-configured KeyProvider instance. If provided, this instance will be used instead of the one specified in the configuration. This is useful for injecting a custom key provider that is not discoverable as a standard plugin. |
None
|
plugin_manager
|
Optional[PluginManager]
|
An optional, pre-configured PluginManager instance. If provided, this manager will be used for all plugin discovery and instantiation. This is an advanced use case for scenarios where you need to control the plugin lifecycle externally. If not provided, Genie will create its own internal PluginManager. |
None
|
Returns:
Type | Description |
---|---|
Genie
|
A fully initialized Genie instance, ready for use. |
Source code in src/genie_tooling/genie.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
get_default_embedder
async
¶
Returns the default embedding generator instance for the framework.
This allows extensions and other components to access a shared, pre-configured embedding generator without needing to instantiate their own.
Returns:
Type | Description |
---|---|
Optional[EmbeddingGeneratorPlugin]
|
The configured default EmbeddingGeneratorPlugin instance, or None if |
Optional[EmbeddingGeneratorPlugin]
|
not configured. |
Source code in src/genie_tooling/genie.py
get_default_vector_store
async
¶
Returns the default vector store instance for the framework.
This allows extensions and other components to access a shared, pre-configured vector store for RAG operations.
Returns:
Type | Description |
---|---|
Optional[VectorStorePlugin]
|
The configured default VectorStorePlugin instance, or None if |
Optional[VectorStorePlugin]
|
not configured. |
Source code in src/genie_tooling/genie.py
run_command
async
¶
run_command(
command: str,
processor_id: Optional[str] = None,
conversation_history: Optional[List[ChatMessage]] = None,
context_for_tools: Optional[Dict[str, Any]] = None,
) -> Any
Processes a natural language command to select and execute a tool.
This method orchestrates the full agentic loop for a single turn:
1. Uses a configured CommandProcessorPlugin
to interpret the command.
2. The processor selects a tool and extracts its parameters.
3. If a Human-in-the-Loop (HITL) system is active, it requests approval.
4. If approved (or if HITL is not active), it executes the tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command
|
str
|
The user's natural language command string. |
required |
processor_id
|
Optional[str]
|
Optional ID of a specific |
None
|
conversation_history
|
Optional[List[ChatMessage]]
|
Optional list of previous |
None
|
context_for_tools
|
Optional[Dict[str, Any]]
|
Optional dictionary passed to the |
None
|
Returns:
Type | Description |
---|---|
Any
|
A dictionary representing the outcome. The structure depends on the result |
Any
|
of the command processing and tool execution: |
Any
|
|
Any
|
|
Any
|
|
Any
|
The dictionary may contain other diagnostic keys like |
Source code in src/genie_tooling/genie.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
|
Core Interfaces¶
These interfaces are accessed via attributes on the Genie
facade instance (e.g., genie.llm
, genie.rag
).
genie_tooling.interfaces.LLMInterface ¶
LLMInterface(
llm_provider_manager: LLMProviderManager,
default_provider_id: Optional[str],
output_parser_manager: LLMOutputParserManager,
tracing_manager: Optional[InteractionTracingManager] = None,
guardrail_manager: Optional[GuardrailManager] = None,
token_usage_manager: Optional[TokenUsageManager] = None,
)
Source code in src/genie_tooling/interfaces.py
genie_tooling.interfaces.RAGInterface ¶
RAGInterface(
rag_manager: RAGManager,
config: MiddlewareConfig,
key_provider: KeyProvider,
tracing_manager: Optional[InteractionTracingManager] = None,
)