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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TestResults
results
BenchmarkDotNet.Artifacts
/app
/mcps
.vs
.vscode
.genaiscript
Expand Down
20 changes: 10 additions & 10 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
weak
[file ".gitignore"]
url = https://github.com/devlooped/oss/blob/main/.gitignore
sha = 12c18e78c4bbab118b798d04344e5a5253216841
etag = 09b499201361a59fad0036e925f4008cdd7bdc6723ba37ff18cc509e6024b2bf
sha = c1d29fbde52b1505288e3392e7f5fdcb2299f322
etag = f502a2be3b4155fd86675ef45a4364e598979738128a612deb7db59074f93a51
weak
[file "Directory.Build.rsp"]
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
Expand All @@ -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 = c67952501337303eda0fb8b340cb7606666abd8f
etag = cb83faed0cc8b930a7b6bdc61bea03a54059858cf04353e55fee94d9e3ae0fad
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
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ Uses your own API Key.
[![Seika Logiciel](https://avatars.githubusercontent.com/u/2564602?v=4&s=39 "Seika Logiciel")](https://github.com/SeikaLogiciel)
[![Andrew Grant](https://avatars.githubusercontent.com/devlooped-user?s=39 "Andrew Grant")](https://github.com/wizardness)
[![eska-gmbh](https://avatars.githubusercontent.com/devlooped-team?s=39 "eska-gmbh")](https://github.com/eska-gmbh)
[![Geodata AS](https://avatars.githubusercontent.com/u/5946299?v=4&s=39 "Geodata AS")](https://github.com/geodata-no)


<!-- sponsors.md -->
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
16 changes: 16 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
<IsPackable Condition="'$(PackageId)' != ''">true</IsPackable>
</PropertyGroup>

<PropertyGroup>
<!-- Save original PackageId to restore post-import -->
<_PackageId>$(PackageId)</_PackageId>
<!-- Since we set ImportNuGetBuildTasksPackTargetsFromSdk=false, the Sdk.targets doesn't even provide the path for this property :/ -->
<NuGetBuildTasksPackTargets Condition="'$(NuGetBuildTasksPackTargets)' == ''">$(MSBuildSDKsPath)\..\NuGet.Build.Tasks.Pack.targets</NuGetBuildTasksPackTargets>
</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)</PackageId>
<!-- If no PackageId was originally provided, ensure IsPackable is false -->
<IsPackable Condition="'$(_PackageId)' == ''">false</IsPackable>
</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