Skip to content

Commit

Permalink
Merge pull request #434 from PrefectHQ/fixes-circular-imports-from-op…
Browse files Browse the repository at this point in the history
…enai

fix circular imports
  • Loading branch information
zzstoatzz authored Jul 11, 2023
2 parents f0f2f95 + aed841d commit 909d905
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/marvin/functions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Callable, TypeVar, Optional, Any, Type

from fastapi.routing import APIRouter
from marvin.openai.Function import marvin_fn

from marvin.utilities.types import function_to_model


Expand Down Expand Up @@ -80,6 +80,9 @@ def decorator(fn: Callable[[A], T] = None) -> Callable[[A], T]:
return decorator


marvin_fn = FunctionDecoratorFactory(name="openai", func_class=Function)


class FunctionRegistry(APIRouter):
def __init__(self, function_decorator=marvin_fn, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/marvin/openai/Function/Registry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, validate_arguments
from marvin.utilities.types import function_to_model
from marvin.models.messages import Message
from marvin.openai.Function import marvin_fn, openai_fn
from marvin.openai.Function import openai_fn
from openai.openai_object import OpenAIObject
from marvin.functions import FunctionRegistry

Expand Down

0 comments on commit 909d905

Please sign in to comment.