diff --git a/apps/python-sdk/README.md b/apps/python-sdk/README.md index 43a2fa49..e4442035 100644 --- a/apps/python-sdk/README.md +++ b/apps/python-sdk/README.md @@ -101,6 +101,23 @@ chat = StatefulChat( ) ``` +#### Using a test profile +You can specify a test profile ID to use a specific test configuration: + +```python +response_messages, state = client.chat( + messages=messages, + test_profile_id="" +) + +# or + +chat = StatefulChat( + client, + test_profile_id="" +) +``` + #### Skip tool call runs This will surface the tool calls to the SDK instead of running them automatically on the Rowboat server. diff --git a/apps/python-sdk/pyproject.toml b/apps/python-sdk/pyproject.toml index ad669041..f03b944f 100644 --- a/apps/python-sdk/pyproject.toml +++ b/apps/python-sdk/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "rowboat" -version = "1.0.4" +version = "1.0.6" authors = [ { name = "Your Name", email = "your.email@example.com" }, ] diff --git a/apps/python-sdk/src/rowboat/client.py b/apps/python-sdk/src/rowboat/client.py index d73c01a9..f0ad3b31 100644 --- a/apps/python-sdk/src/rowboat/client.py +++ b/apps/python-sdk/src/rowboat/client.py @@ -27,14 +27,16 @@ class Client: state: Optional[Dict[str, Any]] = None, skip_tool_calls: bool = False, max_turns: int = 3, - workflow_id: Optional[str] = None + workflow_id: Optional[str] = None, + test_profile_id: Optional[str] = None ) -> ApiResponse: request = ApiRequest( messages=messages, state=state, skipToolCalls=skip_tool_calls, maxTurns=max_turns, - workflowId=workflow_id + workflowId=workflow_id, + testProfileId=test_profile_id ) response = requests.post(self.base_url, headers=self.headers, data=request.model_dump_json()) @@ -83,7 +85,8 @@ class Client: state: Optional[Dict[str, Any]] = None, max_turns: int = 3, skip_tool_calls: bool = False, - workflow_id: Optional[str] = None + workflow_id: Optional[str] = None, + test_profile_id: Optional[str] = None ) -> Tuple[List[ApiMessage], Optional[Dict[str, Any]]]: """Stateless chat method that handles a single conversation turn with multiple tool call rounds""" @@ -102,7 +105,8 @@ class Client: state=current_state, skip_tool_calls=skip_tool_calls, max_turns=max_turns, - workflow_id=workflow_id + workflow_id=workflow_id, + test_profile_id=test_profile_id ) current_messages.extend(response_data.messages) @@ -141,7 +145,8 @@ class StatefulChat: system_prompt: Optional[str] = None, max_turns: int = 3, skip_tool_calls: bool = False, - workflow_id: Optional[str] = None + workflow_id: Optional[str] = None, + test_profile_id: Optional[str] = None ) -> None: self.client = client self.tools = tools @@ -150,6 +155,7 @@ class StatefulChat: self.max_turns = max_turns self.skip_tool_calls = skip_tool_calls self.workflow_id = workflow_id + self.test_profile_id = test_profile_id if system_prompt: self.messages.append(SystemMessage(role='system', content=system_prompt)) @@ -167,7 +173,8 @@ class StatefulChat: state=self.state, max_turns=self.max_turns, skip_tool_calls=self.skip_tool_calls, - workflow_id=self.workflow_id + workflow_id=self.workflow_id, + test_profile_id=self.test_profile_id ) # Update internal state diff --git a/apps/python-sdk/src/rowboat/schema.py b/apps/python-sdk/src/rowboat/schema.py index 75f928b0..c95d4554 100644 --- a/apps/python-sdk/src/rowboat/schema.py +++ b/apps/python-sdk/src/rowboat/schema.py @@ -51,6 +51,7 @@ class ApiRequest(BaseModel): skipToolCalls: Optional[bool] = None maxTurns: Optional[int] = None workflowId: Optional[str] = None + testProfileId: Optional[str] = None class ApiResponse(BaseModel): messages: List[ApiMessage]