local aiservice temporary

This commit is contained in:
aseembits93 2026-01-15 18:03:16 -08:00
parent 184b8533e0
commit 3a0e41861c
3 changed files with 6 additions and 1 deletions

View file

@ -55,7 +55,7 @@ class AiServiceClient:
logger.info("Using local AI Service at http://localhost:8000")
console.rule()
return "http://localhost:8000"
return "https://app.codeflash.ai"
return "http://localhost:8000"
def make_ai_service_request(
self,
@ -634,6 +634,7 @@ class AiServiceClient:
test_timeout: int,
trace_id: str,
test_index: int,
is_numerical_code: bool | None = None, # noqa: FBT001
) -> tuple[str, str, str] | None:
"""Generate regression tests for the given function by making a request to the Django endpoint.
@ -670,6 +671,7 @@ class AiServiceClient:
"codeflash_version": codeflash_version,
"is_async": function_to_optimize.is_async,
"call_sequence": self.get_next_sequence(),
"is_numerical_code": is_numerical_code,
}
try:
response = self.make_ai_service_request("/testgen", payload=payload, timeout=self.timeout)

View file

@ -2485,6 +2485,7 @@ class FunctionOptimizer:
test_index,
test_path,
test_perf_path,
self.is_numerical_code,
)
for test_index, (test_path, test_perf_path) in enumerate(
zip(generated_test_paths, generated_perf_test_paths)

View file

@ -27,6 +27,7 @@ def generate_tests(
test_index: int,
test_path: Path,
test_perf_path: Path,
is_numerical_code: bool | None = None, # noqa: FBT001
) -> tuple[str, str, Path] | None:
# TODO: Sometimes this recreates the original Class definition. This overrides and messes up the original
# class import. Remove the recreation of the class definition
@ -42,6 +43,7 @@ def generate_tests(
test_timeout=test_timeout,
trace_id=function_trace_id,
test_index=test_index,
is_numerical_code=is_numerical_code,
)
if response and isinstance(response, tuple) and len(response) == 3:
generated_test_source, instrumented_behavior_test_source, instrumented_perf_test_source = response