|
14 | 14 | SuiteConfig, |
15 | 15 | ) |
16 | 16 | from oculus.framework.runner import EvaluationRunner |
17 | | -from oculus.integrations.fai_integration import create_fai_answer_function |
| 17 | +from oculus.integrations.base import create_answer_function |
| 18 | +from oculus.integrations.factory import create_integration, get_default_integration_type |
18 | 19 | from oculus.utils.file_utils import ( |
19 | 20 | load_json, |
20 | 21 | save_json, |
@@ -99,8 +100,12 @@ def generate_answers_command(args: argparse.Namespace) -> int: |
99 | 100 | return 1 |
100 | 101 |
|
101 | 102 | try: |
102 | | - print(f"Initializing FAI integration for domain: {suite_config.domain}") |
103 | | - answer_fn = create_fai_answer_function(domain=suite_config.domain, model=args.model) |
| 103 | + integration_type = args.integration if hasattr(args, "integration") else get_default_integration_type() |
| 104 | + print(f"Initializing {integration_type} integration for domain: {suite_config.domain}") |
| 105 | + integration = create_integration( |
| 106 | + integration_type=integration_type, domain=suite_config.domain, model=args.model |
| 107 | + ) |
| 108 | + answer_fn = create_answer_function(integration) |
104 | 109 |
|
105 | 110 | runner = EvaluationRunner( |
106 | 111 | suite_name=args.suite, |
@@ -304,8 +309,12 @@ def run_evaluation(args: argparse.Namespace) -> int: |
304 | 309 | return 1 |
305 | 310 |
|
306 | 311 | try: |
307 | | - print(f"Initializing FAI integration for domain: {suite_config.domain}") |
308 | | - answer_fn = create_fai_answer_function(domain=suite_config.domain, model=args.model) |
| 312 | + integration_type = args.integration if hasattr(args, "integration") else get_default_integration_type() |
| 313 | + print(f"Initializing {integration_type} integration for domain: {suite_config.domain}") |
| 314 | + integration = create_integration( |
| 315 | + integration_type=integration_type, domain=suite_config.domain, model=args.model |
| 316 | + ) |
| 317 | + answer_fn = create_answer_function(integration) |
309 | 318 |
|
310 | 319 | runner = EvaluationRunner( |
311 | 320 | suite_name=args.suite, |
@@ -385,6 +394,13 @@ def main() -> int: |
385 | 394 | answer_parser.add_argument("--suite", type=str, required=True, help="Name of the evaluation suite") |
386 | 395 | answer_parser.add_argument("--suite-path", type=Path, default=None, help="Base path to suites directory") |
387 | 396 | answer_parser.add_argument("--run-id", type=str, default=None, help="Unique run identifier") |
| 397 | + answer_parser.add_argument( |
| 398 | + "--integration", |
| 399 | + type=str, |
| 400 | + default=None, |
| 401 | + choices=["fai-local", "fai-http", "vercel-http"], |
| 402 | + help="Integration type (defaults to OCULUS_INTEGRATION env var or fai-local)", |
| 403 | + ) |
388 | 404 | answer_parser.add_argument( |
389 | 405 | "--model", |
390 | 406 | type=str, |
@@ -431,6 +447,13 @@ def main() -> int: |
431 | 447 | run_parser.add_argument("--suite", type=str, required=True, help="Name of the evaluation suite") |
432 | 448 | run_parser.add_argument("--suite-path", type=Path, default=None, help="Base path to suites directory") |
433 | 449 | run_parser.add_argument("--run-id", type=str, default=None, help="Unique run identifier") |
| 450 | + run_parser.add_argument( |
| 451 | + "--integration", |
| 452 | + type=str, |
| 453 | + default=None, |
| 454 | + choices=["fai-local", "fai-http", "vercel-http"], |
| 455 | + help="Integration type (defaults to OCULUS_INTEGRATION env var or fai-local)", |
| 456 | + ) |
434 | 457 | run_parser.add_argument( |
435 | 458 | "--model", |
436 | 459 | type=str, |
|
0 commit comments