From e6ad6e26d1b67c9528cfc14799196c31ece3da30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 10:13:24 +0000 Subject: [PATCH 1/2] feat(api): api update (#325) --- .stats.yml | 2 +- api.md | 10 +- src/julep/resources/sessions.py | 9 +- src/julep/types/__init__.py | 1 - src/julep/types/message_param.py | 220 ------------------ src/julep/types/session.py | 51 +--- src/julep/types/session_chat_params.py | 218 ++++++++++++++++- .../types/session_create_or_update_params.py | 51 +--- src/julep/types/session_create_params.py | 51 +--- src/julep/types/session_reset_params.py | 51 +--- src/julep/types/session_update_params.py | 51 +--- tests/api_resources/test_sessions.py | 8 + 12 files changed, 249 insertions(+), 474 deletions(-) delete mode 100644 src/julep/types/message_param.py diff --git a/.stats.yml b/.stats.yml index f4104e4..453bfe7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 52 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-4d9d1f8b357a593ea53060e994b0e816f251a68e0325f1548e502d4ab2cfdaa6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-5760ee26a52aeee7944d22e76d7b6abe0c216d16e42b43dbd9a529be9149344c.yml diff --git a/api.md b/api.md index cb07db2..112e2bb 100644 --- a/api.md +++ b/api.md @@ -77,15 +77,7 @@ Methods: Types: ```python -from julep.types import ( - ChatInput, - ChatResponse, - Entry, - History, - Message, - Session, - SessionChatResponse, -) +from julep.types import ChatInput, ChatResponse, Entry, History, Session, SessionChatResponse ``` Methods: diff --git a/src/julep/resources/sessions.py b/src/julep/resources/sessions.py index bcebc64..f9128e5 100644 --- a/src/julep/resources/sessions.py +++ b/src/julep/resources/sessions.py @@ -33,7 +33,6 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.history import History from ..types.session import Session -from ..types.message_param import MessageParam from ..types.session_chat_response import SessionChatResponse from ..types.shared.resource_deleted import ResourceDeleted @@ -263,7 +262,7 @@ def chat( self, session_id: str, *, - messages: Iterable[MessageParam], + messages: Iterable[session_chat_params.Message], connection_pool: object | NotGiven = NOT_GIVEN, agent: Optional[str] | NotGiven = NOT_GIVEN, frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, @@ -282,7 +281,7 @@ def chat( stream: bool | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: Optional[session_chat_params.ToolChoice] | NotGiven = NOT_GIVEN, - tools: Iterable[session_chat_params.Tool] | NotGiven = NOT_GIVEN, + tools: Optional[Iterable[session_chat_params.Tool]] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, x_custom_api_key: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -767,7 +766,7 @@ async def chat( self, session_id: str, *, - messages: Iterable[MessageParam], + messages: Iterable[session_chat_params.Message], connection_pool: object | NotGiven = NOT_GIVEN, agent: Optional[str] | NotGiven = NOT_GIVEN, frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, @@ -786,7 +785,7 @@ async def chat( stream: bool | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: Optional[session_chat_params.ToolChoice] | NotGiven = NOT_GIVEN, - tools: Iterable[session_chat_params.Tool] | NotGiven = NOT_GIVEN, + tools: Optional[Iterable[session_chat_params.Tool]] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, x_custom_api_key: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/julep/types/__init__.py b/src/julep/types/__init__.py index 32cc679..31080e3 100644 --- a/src/julep/types/__init__.py +++ b/src/julep/types/__init__.py @@ -16,7 +16,6 @@ from .job_status import JobStatus as JobStatus from .transition import Transition as Transition from .chat_response import ChatResponse as ChatResponse -from .message_param import MessageParam as MessageParam from .doc_embed_params import DocEmbedParams as DocEmbedParams from .task_list_params import TaskListParams as TaskListParams from .user_list_params import UserListParams as UserListParams diff --git a/src/julep/types/message_param.py b/src/julep/types/message_param.py deleted file mode 100644 index e0c5999..0000000 --- a/src/julep/types/message_param.py +++ /dev/null @@ -1,220 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = [ - "MessageParam", - "ContentUnionMember2", - "ContentUnionMember2Content", - "ContentUnionMember2ContentModel7", - "ContentUnionMember2ContentModel7ImageURL", - "ContentUnionMember2AgentsAPIAutogenChatContentModel", - "ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember0", - "ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1", - "ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1Source", - "ToolCall", - "ToolCallChosenFunctionCall", - "ToolCallChosenFunctionCallFunction", - "ToolCallChosenFunctionCallBash20241022", - "ToolCallChosenFunctionCallComputer20241022", - "ToolCallChosenFunctionCallTextEditor20241022", - "ToolCallChosenComputer20241022", - "ToolCallChosenTextEditor20241022", - "ToolCallChosenBash20241022", -] - - -class ContentUnionMember2Content(TypedDict, total=False): - text: Required[str] - - type: Literal["text"] - - -class ContentUnionMember2ContentModel7ImageURL(TypedDict, total=False): - url: Required[str] - - detail: Literal["low", "high", "auto"] - - -class ContentUnionMember2ContentModel7(TypedDict, total=False): - image_url: Required[ContentUnionMember2ContentModel7ImageURL] - """The image URL""" - - type: Literal["image_url"] - - -class ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember0(TypedDict, total=False): - text: Required[str] - - type: Literal["text"] - - -class ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1Source(TypedDict, total=False): - data: Required[str] - - media_type: Required[str] - - type: Literal["base64"] - - -class ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1(TypedDict, total=False): - source: Required[ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1Source] - - type: Literal["image"] - - -class ContentUnionMember2AgentsAPIAutogenChatContentModel(TypedDict, total=False): - content: Required[ - Union[ - Iterable[ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember0], - Iterable[ContentUnionMember2AgentsAPIAutogenChatContentModelContentUnionMember1], - ] - ] - - tool_use_id: Required[str] - - type: Literal["tool_result"] - - -ContentUnionMember2: TypeAlias = Union[ - ContentUnionMember2Content, ContentUnionMember2ContentModel7, ContentUnionMember2AgentsAPIAutogenChatContentModel -] - - -class ToolCallChosenFunctionCallFunction(TypedDict, total=False): - name: Required[str] - - arguments: Optional[str] - - -class ToolCallChosenFunctionCallBash20241022(TypedDict, total=False): - command: Optional[str] - - restart: bool - - -class ToolCallChosenFunctionCallComputer20241022(TypedDict, total=False): - action: Required[ - Literal[ - "key", - "type", - "cursor_position", - "mouse_move", - "left_click", - "right_click", - "middle_click", - "double_click", - "screenshot", - ] - ] - - coordinate: Optional[Iterable[int]] - - text: Optional[str] - - -class ToolCallChosenFunctionCallTextEditor20241022(TypedDict, total=False): - command: Required[Literal["str_replace", "insert", "view", "undo_edit"]] - - path: Required[str] - - file_text: Optional[str] - - insert_line: Optional[int] - - new_str: Optional[str] - - old_str: Optional[str] - - view_range: Optional[Iterable[int]] - - -class ToolCallChosenFunctionCall(TypedDict, total=False): - function: Required[ToolCallChosenFunctionCallFunction] - - api_call: object - - bash_20241022: Optional[ToolCallChosenFunctionCallBash20241022] - - computer_20241022: Optional[ToolCallChosenFunctionCallComputer20241022] - - integration: object - - system: object - - text_editor_20241022: Optional[ToolCallChosenFunctionCallTextEditor20241022] - - type: Literal["function"] - - -class ToolCallChosenComputer20241022(TypedDict, total=False): - action: Required[ - Literal[ - "key", - "type", - "cursor_position", - "mouse_move", - "left_click", - "right_click", - "middle_click", - "double_click", - "screenshot", - ] - ] - - coordinate: Optional[Iterable[int]] - - text: Optional[str] - - -class ToolCallChosenTextEditor20241022(TypedDict, total=False): - command: Required[Literal["str_replace", "insert", "view", "undo_edit"]] - - path: Required[str] - - file_text: Optional[str] - - insert_line: Optional[int] - - new_str: Optional[str] - - old_str: Optional[str] - - view_range: Optional[Iterable[int]] - - -class ToolCallChosenBash20241022(TypedDict, total=False): - command: Optional[str] - - restart: bool - - -ToolCall: TypeAlias = Union[ - ToolCallChosenFunctionCall, - ToolCallChosenComputer20241022, - ToolCallChosenTextEditor20241022, - ToolCallChosenBash20241022, -] - -_MessageParamReservedKeywords = TypedDict( - "_MessageParamReservedKeywords", - { - "continue": Optional[bool], - }, - total=False, -) - - -class MessageParam(_MessageParamReservedKeywords, total=False): - role: Required[Literal["user", "assistant", "system", "tool"]] - - content: Union[str, List[str], Iterable[ContentUnionMember2], None] - - name: Optional[str] - - tool_call_id: Optional[str] - - tool_calls: Optional[Iterable[ToolCall]] diff --git a/src/julep/types/session.py b/src/julep/types/session.py index 58f2f62..8728a5b 100644 --- a/src/julep/types/session.py +++ b/src/julep/types/session.py @@ -1,53 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal from .._models import BaseModel -__all__ = [ - "Session", - "RecallOptions", - "RecallOptionsVectorDocSearch", - "RecallOptionsTextOnlyDocSearch", - "RecallOptionsHybridDocSearch", -] +__all__ = ["Session", "RecallOptions"] -class RecallOptionsVectorDocSearch(BaseModel): - confidence: Optional[float] = None - - lang: Optional[str] = None - - limit: Optional[int] = None - - max_query_length: Optional[int] = None - - metadata_filter: Optional[object] = None - - mmr_strength: Optional[float] = None - - mode: Optional[str] = None - - num_search_messages: Optional[int] = None - - -class RecallOptionsTextOnlyDocSearch(BaseModel): - lang: Optional[str] = None - - limit: Optional[int] = None - - max_query_length: Optional[int] = None - - metadata_filter: Optional[object] = None - - mode: Optional[str] = None - - num_search_messages: Optional[int] = None - - -class RecallOptionsHybridDocSearch(BaseModel): +class RecallOptions(BaseModel): alpha: Optional[float] = None confidence: Optional[float] = None @@ -67,11 +29,6 @@ class RecallOptionsHybridDocSearch(BaseModel): num_search_messages: Optional[int] = None -RecallOptions: TypeAlias = Union[ - RecallOptionsVectorDocSearch, RecallOptionsTextOnlyDocSearch, RecallOptionsHybridDocSearch, None -] - - class Session(BaseModel): id: str diff --git a/src/julep/types/session_chat_params.py b/src/julep/types/session_chat_params.py index 84cadc3..6a4e1e9 100644 --- a/src/julep/types/session_chat_params.py +++ b/src/julep/types/session_chat_params.py @@ -6,10 +6,27 @@ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -from .message_param import MessageParam __all__ = [ "SessionChatParams", + "Message", + "MessageContentUnionMember2", + "MessageContentUnionMember2Content", + "MessageContentUnionMember2ContentModel7", + "MessageContentUnionMember2ContentModel7ImageURL", + "MessageContentUnionMember2AgentsAPIAutogenChatContentModelInput", + "MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember0", + "MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1", + "MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1Source", + "MessageToolCall", + "MessageToolCallChosenFunctionCall", + "MessageToolCallChosenFunctionCallFunction", + "MessageToolCallChosenFunctionCallBash20241022", + "MessageToolCallChosenFunctionCallComputer20241022", + "MessageToolCallChosenFunctionCallTextEditor20241022", + "MessageToolCallChosenComputer20241022", + "MessageToolCallChosenTextEditor20241022", + "MessageToolCallChosenBash20241022", "ResponseFormat", "ResponseFormatSimpleCompletionResponseFormat", "ResponseFormatSchemaCompletionResponseFormat", @@ -80,7 +97,7 @@ class SessionChatParams(TypedDict, total=False): - messages: Required[Iterable[MessageParam]] + messages: Required[Iterable[Message]] connection_pool: object @@ -118,13 +135,208 @@ class SessionChatParams(TypedDict, total=False): tool_choice: Optional[ToolChoice] - tools: Iterable[Tool] + tools: Optional[Iterable[Tool]] top_p: Optional[float] x_custom_api_key: Annotated[str, PropertyInfo(alias="X-Custom-Api-Key")] +class MessageContentUnionMember2Content(TypedDict, total=False): + text: Required[str] + + type: Literal["text"] + + +class MessageContentUnionMember2ContentModel7ImageURL(TypedDict, total=False): + url: Required[str] + + detail: Literal["low", "high", "auto"] + + +class MessageContentUnionMember2ContentModel7(TypedDict, total=False): + image_url: Required[MessageContentUnionMember2ContentModel7ImageURL] + """The image URL""" + + type: Literal["image_url"] + + +class MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember0(TypedDict, total=False): + text: Required[str] + + type: Literal["text"] + + +class MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1Source(TypedDict, total=False): + data: Required[str] + + media_type: Required[str] + + type: Literal["base64"] + + +class MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1(TypedDict, total=False): + source: Required[MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1Source] + + type: Literal["image"] + + +class MessageContentUnionMember2AgentsAPIAutogenChatContentModelInput(TypedDict, total=False): + content: Required[ + Union[ + Iterable[MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember0], + Iterable[MessageContentUnionMember2AgentsAPIAutogenChatContentModelInputContentUnionMember1], + ] + ] + + tool_use_id: Required[str] + + type: Literal["tool_result"] + + +MessageContentUnionMember2: TypeAlias = Union[ + MessageContentUnionMember2Content, + MessageContentUnionMember2ContentModel7, + MessageContentUnionMember2AgentsAPIAutogenChatContentModelInput, +] + + +class MessageToolCallChosenFunctionCallFunction(TypedDict, total=False): + name: Required[str] + + arguments: Optional[str] + + +class MessageToolCallChosenFunctionCallBash20241022(TypedDict, total=False): + command: Optional[str] + + restart: bool + + +class MessageToolCallChosenFunctionCallComputer20241022(TypedDict, total=False): + action: Required[ + Literal[ + "key", + "type", + "cursor_position", + "mouse_move", + "left_click", + "right_click", + "middle_click", + "double_click", + "screenshot", + ] + ] + + coordinate: Optional[Iterable[int]] + + text: Optional[str] + + +class MessageToolCallChosenFunctionCallTextEditor20241022(TypedDict, total=False): + command: Required[Literal["str_replace", "insert", "view", "undo_edit"]] + + path: Required[str] + + file_text: Optional[str] + + insert_line: Optional[int] + + new_str: Optional[str] + + old_str: Optional[str] + + view_range: Optional[Iterable[int]] + + +class MessageToolCallChosenFunctionCall(TypedDict, total=False): + function: Required[MessageToolCallChosenFunctionCallFunction] + + api_call: object + + bash_20241022: Optional[MessageToolCallChosenFunctionCallBash20241022] + + computer_20241022: Optional[MessageToolCallChosenFunctionCallComputer20241022] + + integration: object + + system: object + + text_editor_20241022: Optional[MessageToolCallChosenFunctionCallTextEditor20241022] + + type: Literal["function"] + + +class MessageToolCallChosenComputer20241022(TypedDict, total=False): + action: Required[ + Literal[ + "key", + "type", + "cursor_position", + "mouse_move", + "left_click", + "right_click", + "middle_click", + "double_click", + "screenshot", + ] + ] + + coordinate: Optional[Iterable[int]] + + text: Optional[str] + + +class MessageToolCallChosenTextEditor20241022(TypedDict, total=False): + command: Required[Literal["str_replace", "insert", "view", "undo_edit"]] + + path: Required[str] + + file_text: Optional[str] + + insert_line: Optional[int] + + new_str: Optional[str] + + old_str: Optional[str] + + view_range: Optional[Iterable[int]] + + +class MessageToolCallChosenBash20241022(TypedDict, total=False): + command: Optional[str] + + restart: bool + + +MessageToolCall: TypeAlias = Union[ + MessageToolCallChosenFunctionCall, + MessageToolCallChosenComputer20241022, + MessageToolCallChosenTextEditor20241022, + MessageToolCallChosenBash20241022, +] + +_MessageReservedKeywords = TypedDict( + "_MessageReservedKeywords", + { + "continue": Optional[bool], + }, + total=False, +) + + +class Message(_MessageReservedKeywords, total=False): + role: Required[Literal["user", "assistant", "system", "tool"]] + + content: Union[str, List[str], Iterable[MessageContentUnionMember2], None] + + name: Optional[str] + + tool_call_id: Optional[str] + + tool_calls: Optional[Iterable[MessageToolCall]] + + class ResponseFormatSimpleCompletionResponseFormat(TypedDict, total=False): type: Literal["text", "json_object"] diff --git a/src/julep/types/session_create_or_update_params.py b/src/julep/types/session_create_or_update_params.py index 926d5c8..9c13ff2 100644 --- a/src/julep/types/session_create_or_update_params.py +++ b/src/julep/types/session_create_or_update_params.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias, TypedDict +from typing import List, Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "SessionCreateOrUpdateParams", - "RecallOptions", - "RecallOptionsVectorDocSearch", - "RecallOptionsTextOnlyDocSearch", - "RecallOptionsHybridDocSearch", -] +__all__ = ["SessionCreateOrUpdateParams", "RecallOptions"] class SessionCreateOrUpdateParams(TypedDict, total=False): @@ -42,39 +36,7 @@ class SessionCreateOrUpdateParams(TypedDict, total=False): users: Optional[List[str]] -class RecallOptionsVectorDocSearch(TypedDict, total=False): - confidence: float - - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mmr_strength: float - - mode: str - - num_search_messages: int - - -class RecallOptionsTextOnlyDocSearch(TypedDict, total=False): - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mode: str - - num_search_messages: int - - -class RecallOptionsHybridDocSearch(TypedDict, total=False): +class RecallOptions(TypedDict, total=False): alpha: float confidence: float @@ -92,8 +54,3 @@ class RecallOptionsHybridDocSearch(TypedDict, total=False): mode: str num_search_messages: int - - -RecallOptions: TypeAlias = Union[ - RecallOptionsVectorDocSearch, RecallOptionsTextOnlyDocSearch, RecallOptionsHybridDocSearch -] diff --git a/src/julep/types/session_create_params.py b/src/julep/types/session_create_params.py index c38f4e2..1ca2766 100644 --- a/src/julep/types/session_create_params.py +++ b/src/julep/types/session_create_params.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias, TypedDict +from typing import List, Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "SessionCreateParams", - "RecallOptions", - "RecallOptionsVectorDocSearch", - "RecallOptionsTextOnlyDocSearch", - "RecallOptionsHybridDocSearch", -] +__all__ = ["SessionCreateParams", "RecallOptions"] class SessionCreateParams(TypedDict, total=False): @@ -42,39 +36,7 @@ class SessionCreateParams(TypedDict, total=False): users: Optional[List[str]] -class RecallOptionsVectorDocSearch(TypedDict, total=False): - confidence: float - - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mmr_strength: float - - mode: str - - num_search_messages: int - - -class RecallOptionsTextOnlyDocSearch(TypedDict, total=False): - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mode: str - - num_search_messages: int - - -class RecallOptionsHybridDocSearch(TypedDict, total=False): +class RecallOptions(TypedDict, total=False): alpha: float confidence: float @@ -92,8 +54,3 @@ class RecallOptionsHybridDocSearch(TypedDict, total=False): mode: str num_search_messages: int - - -RecallOptions: TypeAlias = Union[ - RecallOptionsVectorDocSearch, RecallOptionsTextOnlyDocSearch, RecallOptionsHybridDocSearch -] diff --git a/src/julep/types/session_reset_params.py b/src/julep/types/session_reset_params.py index 0a2c8cd..f642cd2 100644 --- a/src/julep/types/session_reset_params.py +++ b/src/julep/types/session_reset_params.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing import Union, Optional -from typing_extensions import Literal, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "SessionResetParams", - "RecallOptions", - "RecallOptionsVectorDocSearch", - "RecallOptionsTextOnlyDocSearch", - "RecallOptionsHybridDocSearch", -] +__all__ = ["SessionResetParams", "RecallOptions"] class SessionResetParams(TypedDict, total=False): @@ -34,39 +28,7 @@ class SessionResetParams(TypedDict, total=False): token_budget: Optional[int] -class RecallOptionsVectorDocSearch(TypedDict, total=False): - confidence: float - - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mmr_strength: float - - mode: str - - num_search_messages: int - - -class RecallOptionsTextOnlyDocSearch(TypedDict, total=False): - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mode: str - - num_search_messages: int - - -class RecallOptionsHybridDocSearch(TypedDict, total=False): +class RecallOptions(TypedDict, total=False): alpha: float confidence: float @@ -84,8 +46,3 @@ class RecallOptionsHybridDocSearch(TypedDict, total=False): mode: str num_search_messages: int - - -RecallOptions: TypeAlias = Union[ - RecallOptionsVectorDocSearch, RecallOptionsTextOnlyDocSearch, RecallOptionsHybridDocSearch -] diff --git a/src/julep/types/session_update_params.py b/src/julep/types/session_update_params.py index 9d9576e..9824c15 100644 --- a/src/julep/types/session_update_params.py +++ b/src/julep/types/session_update_params.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing import Union, Optional -from typing_extensions import Literal, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "SessionUpdateParams", - "RecallOptions", - "RecallOptionsVectorDocSearchUpdate", - "RecallOptionsTextOnlyDocSearchUpdate", - "RecallOptionsHybridDocSearchUpdate", -] +__all__ = ["SessionUpdateParams", "RecallOptions"] class SessionUpdateParams(TypedDict, total=False): @@ -34,39 +28,7 @@ class SessionUpdateParams(TypedDict, total=False): token_budget: Optional[int] -class RecallOptionsVectorDocSearchUpdate(TypedDict, total=False): - confidence: float - - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mmr_strength: float - - mode: str - - num_search_messages: int - - -class RecallOptionsTextOnlyDocSearchUpdate(TypedDict, total=False): - lang: str - - limit: int - - max_query_length: int - - metadata_filter: object - - mode: str - - num_search_messages: int - - -class RecallOptionsHybridDocSearchUpdate(TypedDict, total=False): +class RecallOptions(TypedDict, total=False): alpha: float confidence: float @@ -84,8 +46,3 @@ class RecallOptionsHybridDocSearchUpdate(TypedDict, total=False): mode: str num_search_messages: int - - -RecallOptions: TypeAlias = Union[ - RecallOptionsVectorDocSearchUpdate, RecallOptionsTextOnlyDocSearchUpdate, RecallOptionsHybridDocSearchUpdate -] diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index 59c128d..f930114 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Julep) -> None: forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -92,6 +93,7 @@ def test_method_update_with_all_params(self, client: Julep) -> None: forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -393,6 +395,7 @@ def test_method_create_or_update_with_all_params(self, client: Julep) -> None: forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -534,6 +537,7 @@ def test_method_reset_with_all_params(self, client: Julep) -> None: forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -600,6 +604,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncJulep) -> forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -654,6 +659,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncJulep) -> forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -955,6 +961,7 @@ async def test_method_create_or_update_with_all_params(self, async_client: Async forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, @@ -1096,6 +1103,7 @@ async def test_method_reset_with_all_params(self, async_client: AsyncJulep) -> N forward_tool_calls=True, metadata={}, recall_options={ + "alpha": 0, "confidence": -1, "lang": "lang", "limit": 1, From 01b217b65826f988c346df5e4631f7e4a070b463 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 10:13:45 +0000 Subject: [PATCH 2/2] release: 1.72.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/julep/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c7704ce..e648462 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.71.0" + ".": "1.72.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d80ec..ebbcdb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.72.0 (2025-03-01) + +Full Changelog: [v1.71.0...v1.72.0](/~https://github.com/julep-ai/python-sdk/compare/v1.71.0...v1.72.0) + +### Features + +* **api:** api update ([#325](/~https://github.com/julep-ai/python-sdk/issues/325)) ([e6ad6e2](/~https://github.com/julep-ai/python-sdk/commit/e6ad6e26d1b67c9528cfc14799196c31ece3da30)) + ## 1.71.0 (2025-02-28) Full Changelog: [v1.70.0...v1.71.0](/~https://github.com/julep-ai/python-sdk/compare/v1.70.0...v1.71.0) diff --git a/pyproject.toml b/pyproject.toml index f6a8e7d..a81fcaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "julep" -version = "1.71.0" +version = "1.72.0" description = "The official Python library for the julep API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/julep/_version.py b/src/julep/_version.py index d308555..6b3840c 100644 --- a/src/julep/_version.py +++ b/src/julep/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "julep" -__version__ = "1.71.0" # x-release-please-version +__version__ = "1.72.0" # x-release-please-version