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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gradient-labs"
version = "0.11.2"
version = "0.11.3"
description = "Python bindings for the Gradient Labs API"
readme = "README.md"
requires-python = ">=3.9,<4.0"
Expand Down
8 changes: 7 additions & 1 deletion src/gradient_labs/_conversation_resume.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, Dict, Any
from datetime import datetime

from dataclasses import dataclass
Expand Down Expand Up @@ -27,6 +27,10 @@ class ResumeParams:
# reason optionally allows you to describe why this assignment is happening.
reason: Optional[str] = None

# resources is an arbitrary object attached to the conversation and available to the AI agent
# during the conversation. You can also use resources as parameters for your tools.
resources: Optional[Dict[str, Any]] = None


def resume_conversation(
*, client: HttpClient, conversation_id: str, params: ResumeParams
Expand All @@ -37,6 +41,8 @@ def resume_conversation(
body["assignee_id"] = params.assignee_id
if params.timestamp:
body["timestamp"] = HttpClient.localize(params.timestamp)
if params.resources is not None:
body["resources"] = params.resources

_ = client.put(
path=f"conversations/{conversation_id}/resume",
Expand Down
8 changes: 7 additions & 1 deletion src/gradient_labs/_conversation_start.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Any
from typing import Optional, Dict, Any
from datetime import datetime

from dataclasses import dataclass
Expand Down Expand Up @@ -43,6 +43,10 @@ class StartConversationParams:
# If not given, this will default to the current time.
created: Optional[datetime] = None

# resources is an arbitrary object attached to the conversation and available to the AI agent
# during the conversation. You can also use resources as parameters for your tools.
resources: Optional[Dict[str, Any]] = None


def start_conversation(
*, client: HttpClient, params: StartConversationParams
Expand All @@ -56,6 +60,8 @@ def start_conversation(
body["metadata"] = params.metadata
if params.created is not None:
body["created"] = HttpClient.localize(params.created)
if params.resources is not None:
body["resources"] = params.resources

rsp = client.post(
path="conversations",
Expand Down