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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

See our [API docs](https://api-docs.gradient-labs.ai); chat to us for the password.


11 changes: 2 additions & 9 deletions examples/conversations/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,8 @@
)
logging.info("✅ Human agent message added")

client.add_resource(
conversation_id=conv.id,
name="account-details",
data={
"sort_code": "123456",
"account_type": "personal",
},
)
logging.info("✅ Resource added")
# Note: Resources should be passed during start_conversation or resume_conversation
# via the resources parameter, not added separately afterwards.

client.end_conversation(conversation_id=conv.id)
logging.info(f"✅ Conversation closed: {conv.id}")
Expand Down
31 changes: 0 additions & 31 deletions src/gradient_labs/_conversation_add_resource.py

This file was deleted.

32 changes: 0 additions & 32 deletions src/gradient_labs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from .conversation import Conversation
from ._conversation_add_message import add_message, AddMessageParams, Message
from ._conversation_add_resource import add_resource
from ._conversation_assign import assign_conversation, AssignmentParams
from ._conversation_cancel import cancel_conversation, CancelParams
from ._conversation_event import add_conversation_event, EventParams
Expand Down Expand Up @@ -209,37 +208,6 @@ def add_message(
params=params,
)

def add_resource(
self,
*,
conversation_id: str,
name: str,
data: Any,
) -> None:
"""add_resource adds (or updates) a resource to the conversation (e.g. the
customer's order details) so the AI agent can handle customer-specific queries.

A resource can be any JSON document, as long it is smaller than 1MB. There
are no strict requirements on the format/structure of the document, but we
recommend making attribute names as descriptive as possible.

Over time, the AI agent will learn the structure of your resources - so while
it's fine to add new attributes, you may want to consider using new resource
names when removing attributes or changing the structure of your resources
significantly.

Resource names are case-insensitive and can be anything consisting of letters,
numbers, or any of the following characters: _ - + =.

Names should be descriptive handles that are the same for all conversations
(e.g. "order-details" and "user-profile") not unique identifiers."""
add_resource(
client=self.http_client,
conversation_id=conversation_id,
name=name,
resource=data,
)

def upsert_hand_off_target(self, *, params: UpsertHandOffTargetParams) -> None:
"""upsert_hand_off_target inserts or updates a hand-off target.

Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.