Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chatgpt Agent #1822

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
540eb5d
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Aug 12, 2023
984d44a
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Aug 16, 2023
3d936fc
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Aug 30, 2023
931533a
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Sep 7, 2023
8365c53
drafte chatgpt agent
Sep 7, 2023
25d6a5d
others
Sep 7, 2023
970bf3b
sync plugin, DoTask function interface
Sep 7, 2023
b5a74d8
Merge branch 'flyteorg:master' into chatgpt-agent-sync-plugin
Future-Outlier Sep 11, 2023
6087c5f
requester agent base and chatgpt agent
Sep 11, 2023
f8680a1
Merge branch 'chatgpt-agent-sync-plugin' of https://github.com/Future…
Sep 11, 2023
b225310
Add do task interface
Sep 11, 2023
09bc23a
fix lint
Sep 11, 2023
bd5dbd7
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Sep 13, 2023
aeb5ea1
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Sep 13, 2023
0717e2c
Merge branch 'chatgpt-agent-sync-plugin' of https://github.com/Future…
Sep 17, 2023
54d2ddf
Merge branch 'flyteorg:master' into master
Future-Outlier Sep 17, 2023
541edc6
Merge branch 'flyteorg:master' into master
Future-Outlier Sep 19, 2023
7c9dcbc
upload data v1
Sep 20, 2023
18a9e5d
base_requester and chatgpt_requester succeed
Sep 23, 2023
75573ab
Merge branch 'flyteorg:master' into master
Future-Outlier Sep 23, 2023
61e0a76
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Sep 23, 2023
8de3fa8
chatgpt requester v2
Sep 26, 2023
be7d22d
output type
Sep 26, 2023
bca202b
dispatcher
Sep 27, 2023
c0139db
Merge pull request #19 from flyteorg/master
Future-Outlier Sep 28, 2023
cf9ff07
move to plugins directory
Sep 30, 2023
3b13b48
do task agent service
Oct 2, 2023
24df7b3
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 3, 2023
563ca22
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 4, 2023
5fa4f18
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 6, 2023
5f1183b
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 6, 2023
203d2d4
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 7, 2023
9366dfb
Merge branch 'flyteorg:master' into master
Future-Outlier Oct 10, 2023
66f5e60
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Oct 10, 2023
3249963
merge master
Oct 10, 2023
558c6bd
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Oct 11, 2023
9f5dd0a
Merge branch 'master' of https://github.com/Future-Outlier/flytekit
Oct 12, 2023
c91ee4c
refactor
pingsutw Oct 15, 2023
4adf029
refactor
pingsutw Oct 15, 2023
402e1a9
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Oct 15, 2023
2db4de7
Merge branch 'master' into chatgpt-agent-sync-plugin
Oct 15, 2023
420cbf5
chatgpt sync plugin succeed v1
Oct 15, 2023
1208268
chatgpt syncplugin succeed
Oct 16, 2023
a64f6ee
remove unused task metadata
Oct 16, 2023
815dde4
add base_task RuntimeMetadata test and push for gitsha
Oct 16, 2023
9f3072e
fix ExternalApiTask import
Oct 16, 2023
713db18
add for flyteidl version remove for building image
Oct 16, 2023
0ecebdf
ciruclar import
Oct 16, 2023
a058734
add tests and lints
Oct 16, 2023
719ae32
final all tests
Oct 16, 2023
5823cb1
move to flytekit-openai-chatgpt dir and add setup.py python 3.11 test
Oct 17, 2023
c6058fc
delete flytekit-chatgpt
Oct 17, 2023
e6482ae
databricks api bug
Oct 17, 2023
c6343ec
remove output_prefix
Oct 17, 2023
ee0b829
make lint will make logger can't be import
Oct 17, 2023
a9b16c8
improve excutor task
Oct 18, 2023
d2ebf6c
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Oct 20, 2023
a660fc1
FLYTE_OPENAI_ACCESS_TOKEN
Oct 20, 2023
a3b0ecc
add requirements
Oct 28, 2023
bc9fb27
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Oct 31, 2023
6de876b
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Oct 31, 2023
f785a19
use openai async create function and change test
Nov 1, 2023
ff44060
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Nov 3, 2023
8892dee
change the runtime flavor by specifying str value
Nov 3, 2023
1810a7b
add depedencies
Nov 6, 2023
8d5bb61
add timeout seconds in ChatGPT
Nov 7, 2023
fd8dd5d
change await place in async do task function
Nov 8, 2023
36b315e
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Nov 8, 2023
e6b0ba0
fix circular import
Nov 7, 2023
dc87c81
Update flytekit/extend/backend/base_agent.py
Future-Outlier Nov 8, 2023
8ea1a9d
Update tests/flytekit/unit/core/test_task_metadata.py
Future-Outlier Nov 8, 2023
42b8d90
add runtime flavor variavle in all async plugin and sync plugin test
Nov 9, 2023
14a2698
add TaskExecutor comment
Nov 9, 2023
67582fd
change the argument task type used in sensor engine and api_task engi…
Nov 10, 2023
c273689
support more arguments in do task agent
Nov 10, 2023
232c80c
add annotations
Nov 15, 2023
f842fdd
move argument openai_organization to optional
Nov 15, 2023
835c48a
SyncAgentServiceServicer
Nov 17, 2023
d1e99be
make organization as a required arguement back
Nov 20, 2023
b0670d3
use is_sync_plugin varaible
Nov 21, 2023
6e8f30d
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Nov 21, 2023
104ba6f
ruff fmt
Nov 21, 2023
ec35714
add todo
Nov 22, 2023
c463992
use plugin_metadata by default
Nov 24, 2023
9758ce6
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Nov 24, 2023
868f81b
remove print debug
Nov 24, 2023
0068137
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Dec 13, 2023
6d15fdc
move to rich click
Dec 13, 2023
b56c845
Merge branch 'master' of https://github.com/Future-Outlier/flytekit i…
Dec 13, 2023
510711e
change to agentServicer, agentExecutorMixin, and use is_sync attribute
Dec 13, 2023
9d1e5bd
rename async agent service
Dec 19, 2023
b09a627
remove is_sync
Dec 19, 2023
5a0348b
remove is_sync
Dec 19, 2023
ea91dc7
fix pickle error
Dec 19, 2023
7786aca
remove new line
Dec 19, 2023
ca34c61
rename task config
Dec 19, 2023
1d9535d
use SyncAgentBase
Dec 20, 2023
68fd527
remove print
Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flytekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@
StructuredDatasetType,
)

from flytekit.extend.backend.task_executor import SyncAgentBase # isort:skip. This is for circular import avoidance.


def current_context() -> ExecutionParameters:
"""
Expand Down
71 changes: 71 additions & 0 deletions flytekit/core/external_api_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import collections
import inspect
from abc import abstractmethod
from typing import Any, Dict, Optional, TypeVar

from flyteidl.admin.agent_pb2 import CreateTaskResponse
from typing_extensions import get_type_hints

from flytekit.configuration import SerializationSettings
from flytekit.core.base_task import PythonTask
from flytekit.core.interface import Interface
from flytekit.extend.backend.base_agent import AsyncAgentExecutorMixin

T = TypeVar("T")
TASK_MODULE = "task_module"
TASK_NAME = "task_name"
TASK_CONFIG = "task_config"
TASK_TYPE = "api_task"


class ExternalApiTask(AsyncAgentExecutorMixin, PythonTask):
"""
Base class for all external API tasks. External API tasks are tasks that are designed to run until they receive a
response from an external service. When the response is received, the task will complete. External API tasks are
designed to be run by the flyte agent.
"""

def __init__(
self,
name: str,
config: Optional[T] = None,
task_type: str = TASK_TYPE,
return_type: Optional[Any] = None,
**kwargs,
):
type_hints = get_type_hints(self.do, include_extras=True)
signature = inspect.signature(self.do)
inputs = collections.OrderedDict()
outputs = collections.OrderedDict({"o0": return_type}) if return_type else collections.OrderedDict()

for k, _ in signature.parameters.items(): # type: ignore
annotation = type_hints.get(k, None)
inputs[k] = annotation

super().__init__(
task_type=task_type,
name=name,
task_config=config,
interface=Interface(inputs=inputs, outputs=outputs),
**kwargs,
)

self._task_config = config

@abstractmethod
async def do(self, **kwargs) -> CreateTaskResponse:
"""
Initiate an HTTP request to an external service such as OpenAI or Vertex AI and retrieve the response.
"""
raise NotImplementedError

def get_custom(self, settings: SerializationSettings = None) -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to use pickle?
cc @pingsutw do you know? is this to maintain simply python coversion? This is potentially dangerous as it may break across python versions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pickle is faster, we've talked about this before and Kevin told me that it might be ok.
Will there be multiple python versions usecases?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot control backend and flytekit version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, I fix it!
Thank you very much for your advice!

cfg = {
TASK_MODULE: type(self).__module__,
TASK_NAME: type(self).__name__,
}

if self._task_config is not None:
cfg[TASK_CONFIG] = self._task_config

return cfg
7 changes: 5 additions & 2 deletions flytekit/extend/backend/agent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
def agent_exception_handler(func):
async def wrapper(
self,
request: typing.Union[CreateTaskRequest, GetTaskRequest, DeleteTaskRequest],
request: typing.Union[
CreateTaskRequest,
GetTaskRequest,
DeleteTaskRequest,
],
context: grpc.ServicerContext,
*args,
**kwargs,
Expand Down Expand Up @@ -92,7 +96,6 @@ async def CreateTask(self, request: CreateTaskRequest, context: grpc.ServicerCon
tmp = TaskTemplate.from_flyte_idl(request.template)
inputs = LiteralMap.from_flyte_idl(request.inputs) if request.inputs else None
agent = AgentRegistry.get_agent(tmp.type)

logger.info(f"{tmp.type} agent start creating the job")
if agent.asynchronous:
return await agent.async_create(
Expand Down
46 changes: 32 additions & 14 deletions flytekit/extend/backend/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from abc import ABC
from collections import OrderedDict
from functools import partial
from types import FrameType
from types import FrameType, coroutine

import grpc
from flyteidl.admin.agent_pb2 import (
Expand Down Expand Up @@ -138,7 +138,8 @@ def convert_to_flyte_state(state: str) -> State:
Convert the state from the agent to the state in flyte.
"""
state = state.lower()
if state in ["failed", "timedout", "canceled"]:
# timedout is the state of Databricks job. https://docs.databricks.com/en/workflows/jobs/jobs-2.0-api.html#runresultstate
if state in ["failed", "timeout", "timedout", "canceled"]:
return RETRYABLE_FAILURE
elif state in ["done", "succeeded", "success"]:
return SUCCEEDED
Expand All @@ -158,15 +159,27 @@ def get_agent_secret(secret_key: str) -> str:
return flytekit.current_context().secrets.get(secret_key)


def _get_grpc_context() -> grpc.ServicerContext:
from unittest.mock import MagicMock

grpc_ctx = MagicMock(spec=grpc.ServicerContext)
return grpc_ctx


class AsyncAgentExecutorMixin:
"""
This mixin class is used to run the agent task locally, and it's only used for local execution.
Task should inherit from this class if the task can be run in the agent.
It can handle asynchronous tasks and synchronous tasks.
Asynchronous tasks are for tasks running long, for example running query job.
Synchronous tasks are for tasks running quick, for example, you want to execute something really fast, or even retrieving some metadata from a backend service.
"""

_is_canceled = None
_agent = None
_entity = None
_clean_up_task: coroutine = None
_agent: AgentBase = None
_entity: PythonTask = None
_ctx: FlyteContext = FlyteContext.current_context()
_grpc_ctx: grpc.ServicerContext = _get_grpc_context()

def execute(self, **kwargs) -> typing.Any:
ctx = FlyteContext.current_context()
Expand All @@ -180,6 +193,13 @@ def execute(self, **kwargs) -> typing.Any:
self._agent = AgentRegistry.get_agent(task_template.type)

res = asyncio.run(self._create(task_template, output_prefix, kwargs))

# If the task is synchronous, the agent will return the output from the resource literals.
if res.HasField("resource"):
if res.resource.state != SUCCEEDED:
raise FlyteUserException(f"Failed to run the task {self._entity.name}")
return LiteralMap.from_flyte_idl(res.resource.outputs)

res = asyncio.run(self._get(resource_meta=res.resource_meta))

if res.resource.state != SUCCEEDED:
Expand All @@ -198,7 +218,6 @@ async def _create(
self, task_template: TaskTemplate, output_prefix: str, inputs: typing.Dict[str, typing.Any] = None
) -> CreateTaskResponse:
ctx = FlyteContext.current_context()
grpc_ctx = _get_grpc_context()

# Convert python inputs to literals
literals = inputs or {}
Expand All @@ -213,9 +232,9 @@ async def _create(
task_template = render_task_template(task_template, output_prefix)

if self._agent.asynchronous:
res = await self._agent.async_create(grpc_ctx, output_prefix, task_template, inputs)
res = await self._agent.async_create(self._grpc_ctx, output_prefix, task_template, literal_map)
else:
res = self._agent.create(grpc_ctx, output_prefix, task_template, inputs)
res = self._agent.create(self._grpc_ctx, output_prefix, task_template, literal_map)

signal.signal(signal.SIGINT, partial(self.signal_handler, res.resource_meta)) # type: ignore
return res
Expand All @@ -232,8 +251,8 @@ async def _get(self, resource_meta: bytes) -> GetTaskResponse:
time.sleep(1)
if self._agent.asynchronous:
res = await self._agent.async_get(grpc_ctx, resource_meta)
if self._is_canceled:
await self._is_canceled
if self._clean_up_task:
await self._clean_up_task
sys.exit(1)
else:
res = self._agent.get(grpc_ctx, resource_meta)
Expand All @@ -242,12 +261,11 @@ async def _get(self, resource_meta: bytes) -> GetTaskResponse:
return res

def signal_handler(self, resource_meta: bytes, signum: int, frame: FrameType) -> typing.Any:
grpc_ctx = _get_grpc_context()
if self._agent.asynchronous:
if self._is_canceled is None:
self._is_canceled = asyncio.create_task(self._agent.async_delete(grpc_ctx, resource_meta))
if self._clean_up_task is None:
self._clean_up_task = asyncio.create_task(self._agent.async_delete(self._grpc_ctx, resource_meta))
else:
self._agent.delete(grpc_ctx, resource_meta)
self._agent.delete(self._grpc_ctx, resource_meta)
sys.exit(1)


Expand Down
71 changes: 71 additions & 0 deletions flytekit/extend/backend/task_executor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import importlib
import typing
from dataclasses import dataclass
from typing import final

import grpc
from flyteidl.admin.agent_pb2 import CreateTaskResponse

from flytekit import FlyteContextManager
from flytekit.core.external_api_task import TASK_CONFIG, TASK_MODULE, TASK_NAME, TASK_TYPE
from flytekit.core.type_engine import TypeEngine
from flytekit.extend.backend.base_agent import AgentBase, AgentRegistry
from flytekit.models.literals import LiteralMap
from flytekit.models.task import TaskTemplate

T = typing.TypeVar("T")


@dataclass
class IOContext:
inputs: LiteralMap
output_prefix: str


class SyncAgentBase(AgentBase):
"""
SyncAgentBase is an agent responsible for syncrhounous tasks, which are fast and quick.

This class is meant to be subclassed when implementing plugins that require
an external API to perform the task execution. It provides a routing mechanism
to direct the task to the appropriate handler based on the task's specifications.
"""

def __init__(self):
super().__init__(task_type=TASK_TYPE, asynchronous=True)

@final
async def async_create(
Copy link
Contributor

@kumare3 kumare3 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would change this to SyncAgentBase as follows

class SyncAgentBase(AgentBase):

      @final
      async def async_create( self,
        context: grpc.ServicerContext,  io_ctx: IOContext, task_template: TaskTemplate, 
    ) -> CreateTaskResponse:
          do(context, output_prefix, task_template, inputs)   

    def async do(context, io_ctx, task_template):
        python_interface_inputs = {
            name: TypeEngine.guess_python_type(lt.type) for name, lt in task_template.interface.inputs.items()
        }
        ctx = FlyteContextManager.current_context()

        native_inputs = {}
        if inputs:
            native_inputs = TypeEngine.literal_map_to_kwargs(ctx, inputs, python_interface_inputs)

        meta = task_template.custom

        task_module = importlib.import_module(name=meta[TASK_MODULE])
        task_def = getattr(task_module, meta[TASK_NAME])
        config = jsonpickle.decode(meta[TASK_CONFIG_PKL]) if meta.get(TASK_CONFIG_PKL) else None
        return task_def(TASK_TYPE, config=config).execute(**native_inputs)
            
    async def execute(**kwargs):
         raise NotImplementedError()

Checkout the final decorator - https://docs.python.org/3.8/library/typing.html#typing.final

Independently, lets are make the signature of all the get/create/delete methods simpler. Think, if we have to refactor the signature in the future how can you do it easily?

@dataclass
class IOContext():
     inputs: LiteralMap
     output_prefix: str

OR change the signature to have **kwargs so that we maintain ease of refactoring

def __init__(self, *args, **kwargs):
   ...

async def create(ctx, inputs, outputs, task_template, **kwargs):
   ...

self,
context: grpc.ServicerContext,
output_prefix: str,
task_template: TaskTemplate,
inputs: typing.Optional[LiteralMap] = None,
) -> CreateTaskResponse:
return await self.do(context, output_prefix, task_template, inputs)

async def do(
self,
context: grpc.ServicerContext,
output_prefix: str,
task_template: TaskTemplate,
inputs: typing.Optional[LiteralMap] = None,
) -> CreateTaskResponse:
python_interface_inputs = {
name: TypeEngine.guess_python_type(lt.type) for name, lt in task_template.interface.inputs.items()
}
ctx = FlyteContextManager.current_context()

native_inputs = {}
if inputs:
native_inputs = TypeEngine.literal_map_to_kwargs(ctx, inputs, python_interface_inputs)

meta = task_template.custom

task_module = importlib.import_module(name=meta[TASK_MODULE])
task_def = getattr(task_module, meta[TASK_NAME])
config = meta[TASK_CONFIG] if meta.get(TASK_CONFIG) else None
return await task_def(TASK_TYPE, config=config).do(**native_inputs)


AgentRegistry.register(SyncAgentBase())
3 changes: 1 addition & 2 deletions flytekit/models/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
from flytekit.exceptions import user as _user_exceptions
from flytekit.models import common as _common
from flytekit.models.core import types as _core_types
from flytekit.models.types import Error
from flytekit.models.types import Error, StructuredDatasetType
from flytekit.models.types import LiteralType as _LiteralType
from flytekit.models.types import OutputReference as _OutputReference
from flytekit.models.types import SchemaType as _SchemaType
from flytekit.models.types import StructuredDatasetType


class RetryStrategy(_common.FlyteIdlEntity):
Expand Down
3 changes: 2 additions & 1 deletion flytekit/sensor/base_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SENSOR_MODULE = "sensor_module"
SENSOR_NAME = "sensor_name"
SENSOR_CONFIG_PKL = "sensor_config_pkl"
SENSOR_TYPE = "sensor"
INPUTS = "inputs"


Expand All @@ -35,7 +36,7 @@ def __init__(
type_hints = get_type_hints(self.poke, include_extras=True)
signature = inspect.signature(self.poke)
inputs = collections.OrderedDict()
for k, v in signature.parameters.items(): # type: ignore
for k, _ in signature.parameters.items(): # type: ignore
annotation = type_hints.get(k, None)
inputs[k] = annotation

Expand Down
6 changes: 4 additions & 2 deletions flytekit/sensor/sensor_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from flytekit.extend.backend.base_agent import AgentBase, AgentRegistry
from flytekit.models.literals import LiteralMap
from flytekit.models.task import TaskTemplate
from flytekit.sensor.base_sensor import INPUTS, SENSOR_CONFIG_PKL, SENSOR_MODULE, SENSOR_NAME
from flytekit.sensor.base_sensor import INPUTS, SENSOR_CONFIG_PKL, SENSOR_MODULE, SENSOR_NAME, SENSOR_TYPE

T = typing.TypeVar("T")

Expand All @@ -39,9 +39,11 @@ async def async_create(
name: TypeEngine.guess_python_type(lt.type) for name, lt in task_template.interface.inputs.items()
}
ctx = FlyteContextManager.current_context()

if inputs:
native_inputs = TypeEngine.literal_map_to_kwargs(ctx, inputs, python_interface_inputs)
task_template.custom[INPUTS] = native_inputs

return CreateTaskResponse(resource_meta=cloudpickle.dumps(task_template.custom))

async def async_get(self, context: grpc.ServicerContext, resource_meta: bytes) -> GetTaskResponse:
Expand All @@ -52,7 +54,7 @@ async def async_get(self, context: grpc.ServicerContext, resource_meta: bytes) -
sensor_config = jsonpickle.decode(meta[SENSOR_CONFIG_PKL]) if meta.get(SENSOR_CONFIG_PKL) else None

inputs = meta.get(INPUTS, {})
cur_state = SUCCEEDED if await sensor_def("sensor", config=sensor_config).poke(**inputs) else RUNNING
cur_state = SUCCEEDED if await sensor_def(SENSOR_TYPE, config=sensor_config).poke(**inputs) else RUNNING
return GetTaskResponse(resource=Resource(state=cur_state, outputs=None))

async def async_delete(self, context: grpc.ServicerContext, resource_meta: bytes) -> DeleteTaskResponse:
Expand Down
2 changes: 2 additions & 0 deletions plugins/flytekit-aws-athena/flytekitplugins/athena/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from flytekit.configuration import SerializationSettings
from flytekit.extend import SQLTask
from flytekit.extend.backend.base_agent import ASYNC_PLUGIN
from flytekit.models.presto import PrestoQuery
from flytekit.types.schema import FlyteSchema

Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
inputs=inputs,
outputs=outputs,
task_type=self._TASK_TYPE,
runtime_flavor=ASYNC_PLUGIN,
**kwargs,
)
self._output_schema_type = output_schema_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def __init__(self, task_config: AWSBatchConfig, task_function: Callable, **kwarg
if task_config is None:
task_config = AWSBatchConfig()
super(AWSBatchFunctionTask, self).__init__(
task_config=task_config, task_type=self._AWS_BATCH_TASK_TYPE, task_function=task_function, **kwargs
task_config=task_config,
task_type=self._AWS_BATCH_TASK_TYPE,
task_function=task_function,
**kwargs,
)
self._task_config = task_config

Expand Down
1 change: 1 addition & 0 deletions plugins/flytekit-openai-chatgpt/dev-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest-asyncio
20 changes: 20 additions & 0 deletions plugins/flytekit-openai-chatgpt/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile dev-requirements.in
#
exceptiongroup==1.1.3
# via pytest
iniconfig==2.0.0
# via pytest
packaging==23.2
# via pytest
pluggy==1.3.0
# via pytest
pytest==7.4.2
# via pytest-asyncio
pytest-asyncio==0.21.1
# via -r dev-requirements.in
tomli==2.0.1
# via pytest
Loading