Skip to content
Open
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
16 changes: 8 additions & 8 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@
weak
[file "src/Directory.Build.props"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
sha = dd13ed3334135c30dcb1e3b2295dc7622de298d9
etag = b2b90c6d617db9712cc8be2031b767d3ba951015717984f52b4872cc39f93e72
sha = 6e2438919e108aeb75106dc0737c45f5e55d5f42
etag = f1d6384abf18d8d891ce5e835a10c73fe029c42151374be96d7e4af43d189c65
weak
[file "src/Directory.Build.targets"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
sha = 083a37bd9307ec820bac6ee3c7384083151d36d8
etag = 907682e5632a2ba430357e6e042a4ca33cb8c94a3a215d3091aa03f5958a4877
sha = 6e2438919e108aeb75106dc0737c45f5e55d5f42
etag = 31cf95c54402944a7aeddcde93cea5f2403ae594212307513d9b93c53ef62fb6
weak
[file "src/nuget.config"]
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
Expand Down Expand Up @@ -152,8 +152,8 @@
weak
[file "src/xAI.Protocol/chat.proto"]
url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/chat.proto
sha = c9345abd85649ecb5b27fe8708f573b4ab9d6971
etag = a64a560fdac1cb6d349d38b19a58605fa59169879f3d6d517518e573fd137b8c
sha = 543b901d69762b8e96f72450ac3619332eba698a
etag = 22ba3971b319bccdde31765038300c8e70fee80b7bb239ed7b427c014e35ab1b
weak
[file "src/xAI.Protocol/deferred.proto"]
url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/deferred.proto
Expand Down Expand Up @@ -192,8 +192,8 @@
weak
[file "src/xAI.Protocol/usage.proto"]
url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/usage.proto
sha = 362749661fa2d340d234ad372fab920538897821
etag = 9fcf9731a547857d554e968968aedc3016fc5210e0a45d5b59d75a03b816a81e
sha = 64093a42a740c2b28d62281db11ee633c1df6ea1
etag = ab94abd9c126b5ade766ec41f1e200412de6b37b4b2ed224897df72ab9e162bb
weak
[file "src/xAI.Protocol/video.proto"]
url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/video.proto
Expand Down
3 changes: 3 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<!-- See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#prunepackagereference-specification -->
<RestoreEnablePackagePruning>true</RestoreEnablePackagePruning>

<!-- Needed to improve nuget default for empty PackageId. Workaround for https://github.com/NuGet/Home/issues/14928 -->
<ImportNuGetBuildTasksPackTargetsFromSdk>false</ImportNuGetBuildTasksPackTargetsFromSdk>
</PropertyGroup>

<PropertyGroup Label="Build">
Expand Down
7 changes: 7 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
<IsPackable Condition="'$(PackageId)' != ''">true</IsPackable>
</PropertyGroup>

<Import Project="$(NuGetBuildTasksPackTargets)" Condition="Exists('$(NuGetBuildTasksPackTargets)')"/>

<PropertyGroup>
<!-- Revert the forced PackageId by the NuGet SDK targets for non-packable projects, see https://github.com/NuGet/Home/issues/14928 -->
<PackageId Condition="'$(IsPackable)' == 'false'"></PackageId>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'" Label="NuGet">
<!-- This is compatible with nugetizer and SDK pack -->
<!-- Only difference is we don't copy either to output directory -->
Expand Down
39 changes: 39 additions & 0 deletions src/xAI.Protocol/chat.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ service Chat {

// Delete a stored response using the response ID.
rpc DeleteStoredCompletion(DeleteStoredCompletionRequest) returns (DeleteStoredCompletionResponse) {}

// Compacts a full input context and returns a compacted context.
// The client sends the current input items and receives back a compacted
// set of items (with an opaque compaction blob) suitable for use as
// the input to the next request.
rpc CompactContext(CompactContextRequest) returns (CompactContextResponse) {}
}

message GetCompletionsRequest {
Expand Down Expand Up @@ -675,6 +681,9 @@ message WebSearch {
// Setting this will make the agentic search results more relevant to the specified location,
// which is useful for geolocation-based search results refinement.
optional WebSearchUserLocation user_location = 4;

// Enable image search results that can be embedded in responses.
optional bool enable_image_search = 5;
}

// The user location to use for a preference on the search results.
Expand Down Expand Up @@ -1127,3 +1136,33 @@ message DebugOutput {
// The tag of the sampler that served this request.
string sampler_tag = 11;
}

// ── Context compaction messages ─────────────────────────────────────────

// Request for the standalone CompactContext RPC.
message CompactContextRequest {
// Model to use for generating the compaction blob.
string model = 1;

// Full current input window as proto messages.
// This is the same set of messages the client would send in
// GetCompletionsRequest.messages.
repeated Message input = 2;
}

// Response from the standalone CompactContext RPC.
message CompactContextResponse {
// Unique compaction ID (e.g. cmp_<uuid>).
string id = 1;

// Opaque blob representing the compacted conversation. Clients must pass
// this back unchanged in subsequent requests.
string encrypted_content = 2;

// Number of input Message entries (role + content pairs) from the
// original input that were dropped or folded into the compacted blob.
uint32 dropped_message_count = 3;

// Token usage from the compacting model call.
SamplingUsage usage = 4;
}
2 changes: 1 addition & 1 deletion src/xAI.Protocol/usage.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
syntax = "proto3";
option csharp_namespace = "xAI.Protocol";

package xai_api;

Expand Down Expand Up @@ -65,4 +64,5 @@ enum ServerSideTool {
SERVER_SIDE_TOOL_COLLECTIONS_SEARCH = 6;
SERVER_SIDE_TOOL_MCP = 7;
SERVER_SIDE_TOOL_ATTACHMENT_SEARCH = 8;
SERVER_SIDE_TOOL_IMAGE_SEARCH = 10;
}
Loading