Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
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
2 changes: 1 addition & 1 deletion .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ AZURE_OPENAI_SORA_KEY="xxxxxxx"

OPENAI_SORA_ENDPOINT = ${AZURE_OPENAI_SORA_ENDPOINT}
OPENAI_SORA_KEY = ${AZURE_OPENAI_SORA_KEY}
OPENAI_SORA_MODEL = ""
OPENAI_SORA_MODEL = "sora-2"


##################################
Expand Down
16 changes: 16 additions & 0 deletions .env_local_example
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,21 @@ GLOBAL_MEMORY_LABELS = {"username": "username"}
##############
#OPENAI_CHAT_ADDITIONAL_REQUEST_HEADERS="<Provide headers using a dictionary format. Ex., {'key1':'value1'}>"

##############
# OpenAI Sora-2 Target Configuration
# Works with both standard OpenAI Sora-2 API and Azure OpenAI Sora-2 deployments
##############

# OpenAI Sora-2 configuration
OPENAI_SORA_ENDPOINT="https://api.openai.com/v1/videos"
OPENAI_SORA_KEY="your-openai-api-key"
OPENAI_SORA_MODEL="sora-2"

# For Azure OpenAI Sora-2, override with your Azure endpoint and key:
OPENAI_SORA_ENDPOINT="https://your-resource.cognitiveservices.azure.com/openai/v1/video/generations"
OPENAI_SORA_KEY="your-azure-openai-key"
OPENAI_SORA_MODEL="sora-2"


# Specify to run tests that may be skipped in the pipeline
#RUN_ALL_TESTS="true"
6 changes: 4 additions & 2 deletions pyrit/common/net_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async def make_request_and_raise_if_error_async(
debug: bool = False,
params: Optional[dict[str, str]] = None,
request_body: Optional[dict[str, object]] = None,
files: Optional[dict[str, tuple]] = None,
headers: Optional[dict[str, str]] = None,
**httpx_client_kwargs: Optional[Any],
) -> httpx.Response:
Expand All @@ -46,8 +47,9 @@ async def make_request_and_raise_if_error_async(
method=method,
params=params,
url=endpoint_uri,
json=request_body if request_body and post_type == "json" else None,
data=request_body if request_body and post_type != "json" else None,
json=request_body if request_body and post_type == "json" and not files else None,
data=request_body if request_body and post_type != "json" and not files else None,
files=files if files else None,
headers=headers,
)

Expand Down
Loading
Loading