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

Make openai_organization Optional in OpenAI plugins #2585

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class BatchEndpointTask(AsyncAgentExecutorMixin, PythonTask):
def __init__(
self,
name: str,
openai_organization: str,
config: Dict[str, Any],
openai_organization: Optional[str] = "",
**kwargs,
):
super().__init__(
Expand Down Expand Up @@ -70,8 +70,8 @@ class OpenAIFileDefaultImages(DefaultImages):

@dataclass
class OpenAIFileConfig:
openai_organization: str
secret: Secret
openai_organization: Optional[str] = ""

def _secret_to_dict(self) -> Dict[str, Optional[str]]:
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

def create_batch(
name: str,
openai_organization: str,
secret: Secret,
openai_organization: Optional[str] = "",
config: Optional[Dict[str, Any]] = None,
is_json_iterator: bool = True,
file_upload_mem: str = "700Mi",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict
from typing import Any, Dict, Optional

from flytekit.configuration import SerializationSettings
from flytekit.core.base_task import PythonTask
Expand All @@ -13,7 +13,7 @@ class ChatGPTTask(SyncAgentExecutorMixin, PythonTask):

_TASK_TYPE = "chatgpt"

def __init__(self, name: str, openai_organization: str, chatgpt_config: Dict[str, Any], **kwargs):
def __init__(self, name: str, chatgpt_config: Dict[str, Any], openai_organization: Optional[str] = "", **kwargs):
"""
Args:
name: Name of this task, should be unique in the project
Expand Down
Loading