-
Notifications
You must be signed in to change notification settings - Fork 286
Updated protocol schema to add context sharing support #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sveluvil
wants to merge
2
commits into
main
Choose a base branch
from
sveluvil/context
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+40
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1952,6 +1952,7 @@ Activity [entities](#entity) communicate extra metadata about the activity, such | |
| | number | N/A | Number | | ||
| | clientInfo | N/A | Skype client info | | ||
| | streamInfo | N/A | Streaming text metadata | | ||
| | context | N/A | Screen and visual context metadata which can be used as Query context | | ||
|
|
||
| ### string and number | ||
|
|
||
|
|
@@ -2200,6 +2201,45 @@ Voice streaming uses `event` activities with [Media.* events](#reserved-events-f | |
| } | ||
| ``` | ||
|
|
||
| ### context | ||
| The context entity contains contextual information between users and agents to improve understanding of ongoing conversations. This enables more relevant, personalized, and accurate responses, especially in multimodal interactions. By embedding context directly in the activity message, agents can leverage contextual information such as images, custom objects, and audio/video-related context. | ||
| Context can only be shared with activity type `message`, and it can be send from any channel. | ||
| There is no strict limit on the number of images that can be shared. However, it is recommended to keep the number as low as possible, as this directly impacts token consumption. | ||
|
|
||
| | Property | Type | Required | Description | | ||
| |------------------|---------|----------|---------------------------------------------------------------------------------| | ||
| | `type` | string | Yes | Must be `"context"` | | ||
| | `screenContext` | object | Yes | Screen context details | | ||
|
|
||
| The context entity in an activity message can contain a `screenContext` object. This can be a list of screenshots of the page the user is currently on. The images are shared either in base64-encoded format or as a URL. | ||
|
sveluvil marked this conversation as resolved.
sveluvil marked this conversation as resolved.
|
||
|
|
||
| | Property | Type | Required | Description | | ||
| |------------------|------------------|----------|---------------------------------------------------------------------------------| | ||
| | `images` | array of string | Yes | An array of images either in base64-encoded format or as URL | | ||
|
|
||
| `A9263`: If the context contains no elements, it MUST be ignored. | ||
|
|
||
| `A9264`: If the context entity contains any syntactic errors, it MUST be ignored. | ||
|
|
||
| `A9265`: If the `screenContext` object within a `context` entity contains no properties, it MUST be ignored. | ||
|
|
||
| ``` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: ```json |
||
| // Sending context information as part of the activity message | ||
|
sveluvil marked this conversation as resolved.
|
||
| { | ||
| "type": "message", | ||
| "text": "What pizzas are available for $150?", | ||
| "entities": [ | ||
| { | ||
| "type": "context", | ||
| "screenContext": { | ||
| "images": ["iVBORw0KGgoAAAANSUhEUgAAAAUA...", "https://example.com/product-page"] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| # Appendix III - Protocols using the Invoke activity | ||
|
|
||
| The [invoke activity](#invoke-activity) is designed for use only within protocols supported by Activity Protocol channels (i.e., it is not a generic extensibility mechanism). This appendix contains a list of all protocols using this activity. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.