|
6 | 6 | import string |
7 | 7 | import typing |
8 | 8 | from collections.abc import Hashable, Iterable, Mapping, Sequence |
9 | | -from concurrent.futures import Future |
10 | 9 | from typing import Any, get_type_hints |
11 | 10 |
|
12 | 11 | import pydantic |
|
23 | 22 |
|
24 | 23 | from openai.types.responses import FunctionToolParam |
25 | 24 |
|
26 | | -from effectful.handlers.futures import Executor |
27 | 25 | from effectful.handlers.llm import Template |
28 | 26 | from effectful.ops.semantics import fwd |
29 | 27 | from effectful.ops.syntax import ObjectInterpretation, defop, implements |
@@ -378,16 +376,4 @@ def _call[**P, T]( |
378 | 376 | ret_type = template.__signature__.return_annotation |
379 | 377 | bound_args = template.__signature__.bind(*args, **kwargs) |
380 | 378 | bound_args.apply_defaults() |
381 | | - |
382 | | - # Check if return type is Future[T] |
383 | | - origin = typing.get_origin(ret_type) |
384 | | - if origin is Future: |
385 | | - inner_type = typing.get_args(ret_type)[0] |
386 | | - return Executor.submit( |
387 | | - self._openai_api_call, # type: ignore |
388 | | - template, # type: ignore |
389 | | - bound_args, # type: ignore |
390 | | - inner_type, |
391 | | - ) |
392 | | - |
393 | 379 | return self._openai_api_call(template, bound_args, ret_type) |
0 commit comments