Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"numpy >= 1.25.0; python_version < '3.12'",
"numpy >= 1.26.0; python_version >= '3.12'",
# openai connector
"openai >= 1.98.0",
"openai >= 1.98.0, < 2.0.0",
# openapi and swagger
"openapi_core >= 0.18,<0.20",
"websockets >= 13, < 16",
Expand Down Expand Up @@ -121,7 +121,9 @@ ollama = [
"ollama ~= 0.4"
]
onnx = [
"onnxruntime-genai ~= 0.7"
# Pinning due to uv tag-resolution issues on macOS.
"onnxruntime==1.22.1",
"onnxruntime-genai==0.9.0"
]
pandas = [
"pandas ~= 2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from collections.abc import AsyncIterable, Iterable, Sequence
from typing import TYPE_CHECKING, Any, ClassVar, Literal, TypeVar, cast

from openai import NOT_GIVEN, AsyncOpenAI, NotGiven
from openai import AsyncOpenAI
from openai._types import Omit, omit
from openai.types.beta.code_interpreter_tool import CodeInterpreterTool
from openai.types.beta.file_search_tool import FileSearchTool
from openai.types.beta.threads.run_create_params import AdditionalMessage, AdditionalMessageAttachment
Expand Down Expand Up @@ -597,7 +598,7 @@ async def get_messages(
An async iterable of ChatMessageContent.
"""
agent_names: dict[str, Any] = {}
last_id: str | NotGiven = NOT_GIVEN
last_id: str | Omit = omit

while True:
messages = await client.beta.threads.messages.list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from copy import copy, deepcopy
from typing import TYPE_CHECKING, Any, ClassVar, Literal, TypeVar

from openai import NOT_GIVEN, AsyncOpenAI, NotGiven
from openai import AsyncOpenAI
from openai._types import Omit, omit
from openai.lib._parsing._completions import type_to_response_format_param
from openai.types.beta.assistant import Assistant
from openai.types.beta.assistant_create_params import (
Expand Down Expand Up @@ -138,9 +139,9 @@ def __init__(
self,
client: AsyncOpenAI,
thread_id: str | None = None,
messages: Iterable["ThreadCreateMessage"] | NotGiven = NOT_GIVEN,
metadata: dict[str, Any] | NotGiven = NOT_GIVEN,
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
messages: Iterable["ThreadCreateMessage"] | Omit = omit,
metadata: dict[str, Any] | Omit = omit,
tool_resources: ToolResources | Omit = omit,
) -> None:
"""Initialize the OpenAI Assistant Thread.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def configure_web_search_tool(
A WebSearchToolParam dictionary with any passed-in parameters.
"""
tool: WebSearchToolParam = {
"type": "web_search_preview",
"type": "web_search",
}
if context_size is not None:
tool["search_context_size"] = context_size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any, Union

from openai import AsyncOpenAI, AsyncStream, BadRequestError, _legacy_response
from openai._types import NOT_GIVEN, FileTypes, NotGiven
from openai._types import FileTypes, Omit, omit
from openai.lib._parsing._completions import type_to_response_format_param
from openai.types import Completion, CreateEmbeddingResponse
from openai.types.audio import Transcription
Expand Down Expand Up @@ -135,7 +135,7 @@ async def _send_image_edit_request(
self,
image: list[FileTypes],
settings: OpenAITextToImageExecutionSettings,
mask: FileTypes | NotGiven = NOT_GIVEN,
mask: FileTypes | Omit = omit,
) -> ImagesResponse:
"""Send a request to the OpenAI image edit endpoint.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import IO, Any
from warnings import warn

from openai._types import NOT_GIVEN, FileTypes, NotGiven
from openai._types import FileTypes, Omit, omit
from openai.types.images_response import ImagesResponse

from semantic_kernel.connectors.ai.open_ai.prompt_execution_settings.open_ai_text_to_image_execution_settings import (
Expand Down Expand Up @@ -217,7 +217,7 @@ async def edit_image(
elif image_files is not None:
images = list(image_files)

mask: FileTypes | NotGiven = NOT_GIVEN
mask: FileTypes | Omit = omit
if mask_path is not None:
mask = Path(mask_path)
elif mask_file is not None:
Expand Down
Loading
Loading