Skip to content

Commit

Permalink
fix: adapt code to 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalAI21 committed Dec 15, 2024
1 parent 485745f commit 4d0addc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable, List, Dict, Any, Type
from typing import Callable, List, Dict, Any, Type, Union

from pydantic import BaseModel
from ai21.clients.common.beta.assistant.plans import BasePlans
Expand All @@ -13,8 +13,8 @@ def create(
self,
*,
assistant_id: str,
code: str | Callable,
schemas: List[Dict[str, Any]] | List[Type[BaseModel]] | NotGiven = NOT_GIVEN,
code: Union[str, Callable],
schemas: Union[List[Dict[str, Any]], List[Type[BaseModel]], NotGiven] = NOT_GIVEN,
**kwargs,
) -> PlanResponse:
pass
Expand All @@ -26,7 +26,7 @@ def retrieve(self, *, assistant_id: str, plan_id: str) -> PlanResponse:
pass

def modify(
self, *, assistant_id: str, plan_id: str, code: str, schemas: List[Dict[str, Any]] | NotGiven = NOT_GIVEN
self, *, assistant_id: str, plan_id: str, code: str, schemas: Union[List[Dict[str, Any]], NotGiven] = NOT_GIVEN
) -> PlanResponse:
pass

Expand All @@ -51,7 +51,7 @@ def code():
result = PlanTestClass()._create_body(code=code)

# Assert
assert result == {"code": 'def code():\n return "code"'}
assert result == {"code": 'code = lambda: "code"'}


def test_create_body__when_pass_code_and_dict_schemas__should_return_dict_with_schemas():
Expand Down

0 comments on commit 4d0addc

Please sign in to comment.