Skip to content

Commit 4fc696f

Browse files
committed
feat: changes in feedback
1 parent e569013 commit 4fc696f

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

portkey_ai/api_resources/apis/feedback.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Optional, Dict, Any, List
1+
from typing import Optional, Dict, Any, List, Union
2+
from portkey_ai._vendor.openai import NOT_GIVEN, NotGiven
23
from portkey_ai.api_resources.apis.api_resource import APIResource, AsyncAPIResource
34
from portkey_ai.api_resources.base_client import APIClient, AsyncAPIClient
45
from portkey_ai.api_resources.streaming import AsyncStream, Stream
@@ -13,10 +14,10 @@ def __init__(self, client: APIClient) -> None:
1314
def create(
1415
self,
1516
*,
16-
trace_id: Optional[str] = None,
17-
value: Optional[int] = None,
18-
weight: Optional[float] = None,
19-
metadata: Optional[Dict[str, Any]] = None,
17+
trace_id: Union[str, NotGiven] = NOT_GIVEN,
18+
value: Union[int, NotGiven] = NOT_GIVEN,
19+
weight: Union[float, NotGiven] = NOT_GIVEN,
20+
metadata: Union[Dict[str, Any], NotGiven] = NOT_GIVEN,
2021
) -> FeedbackResponse:
2122
body = dict(trace_id=trace_id, value=value, weight=weight, metadata=metadata)
2223
return self._post(
@@ -44,10 +45,10 @@ def bulk_create(self, *, feedbacks: List[Dict[str, Any]]) -> FeedbackResponse:
4445
def update(
4546
self,
4647
*,
47-
feedback_id: Optional[str] = None,
48-
value: Optional[int] = None,
49-
weight: Optional[float] = None,
50-
metadata: Optional[Dict[str, Any]] = None,
48+
feedback_id: Union[str, NotGiven] = NOT_GIVEN,
49+
value: Union[int, NotGiven] = NOT_GIVEN,
50+
weight: Union[float, NotGiven] = NOT_GIVEN,
51+
metadata: Union[Dict[str, Any], NotGiven] = NOT_GIVEN,
5152
) -> FeedbackResponse:
5253
body = dict(value=value, weight=weight, metadata=metadata)
5354

@@ -69,10 +70,10 @@ def __init__(self, client: AsyncAPIClient) -> None:
6970
async def create(
7071
self,
7172
*,
72-
trace_id: Optional[str] = None,
73-
value: Optional[int] = None,
74-
weight: Optional[float] = None,
75-
metadata: Optional[Dict[str, Any]] = None,
73+
trace_id: Union[str, NotGiven] = NOT_GIVEN,
74+
value: Union[int, NotGiven] = NOT_GIVEN,
75+
weight: Union[float, NotGiven] = NOT_GIVEN,
76+
metadata: Union[Dict[str, Any], NotGiven] = NOT_GIVEN,
7677
) -> FeedbackResponse:
7778
body = dict(trace_id=trace_id, value=value, weight=weight, metadata=metadata)
7879
return await self._post(
@@ -100,10 +101,10 @@ async def bulk_create(self, *, feedbacks: List[Dict[str, Any]]) -> FeedbackRespo
100101
async def update(
101102
self,
102103
*,
103-
feedback_id: Optional[str] = None,
104-
value: Optional[int] = None,
105-
weight: Optional[float] = None,
106-
metadata: Optional[Dict[str, Any]] = None,
104+
feedback_id: Union[str, NotGiven] = NOT_GIVEN,
105+
value: Union[int, NotGiven] = NOT_GIVEN,
106+
weight: Union[float, NotGiven] = NOT_GIVEN,
107+
metadata: Union[Dict[str, Any], NotGiven] = NOT_GIVEN,
107108
) -> FeedbackResponse:
108109
body = dict(value=value, weight=weight, metadata=metadata)
109110
return await self._put(

0 commit comments

Comments
 (0)