Skip to content

The Pieces OS Client SDK is a powerful code engine package designed for writing applications on top of Pieces OS.

License

Notifications You must be signed in to change notification settings

pieces-app/pieces-os-client-sdk-for-csharp

Repository files navigation

Pieces

Pieces OS Client SDK For C#

GitHub contributors GitHub issues by-label Publish Client Workflow Status Publish Extensions Workflow Status License

NuGet Version Pieces.Extensions.AI SDK on nuget

Discord Twitter Follow

Introduction

The Pieces OS Client SDK is a set of powerful code engine packages designed for writing applications on top of Pieces OS. It facilitates communication with a locally hosted server to enable features such as copilot chats, asset saving, and more.

This SDK has 2 packages:

  • Pieces.OS.Client - this is the core SDK package providing access to the features of Pieces from your C# application
  • Pieces.Extensions.AI - this is an implementation of Microsoft.Extensions.AI using Pieces to provide support for multiple LLMs, as well as adding context such as snippets, files, folders, and Pieces Long-Term Memory to your AI conversation.

Features

The Pieces SDK offers the following key features:

  1. Copilot Chats: Communicate seamlessly with copilot chats functionality.
  2. Asset Management: Save and manage assets and formats efficiently.
  3. Local Server Interaction: Interact with a locally hosted server for various functionality.
  4. Multi-LLM support: Use any Pieces supported LLM to power your app.
  5. File, folder, and Pieces Long-Term Memory in copilot chats

Installation

To get started with the Pieces OS Client SDK, follow these steps:

  1. Download Pieces OS: Pieces OS serves as the primary backend service, providing essential functionality for the SDK. Download the appropriate version for your operating system:

  2. Install the SDK: Use nuget to install the Pieces OS Client SDK package:

    dotnet add package Pieces.OS.Client --prerelease
  3. Install the Extensions SDK: If you want Microsoft.Extensions.AI support, install the Pieces.Extensions.AI package:

    dotnet add package Pieces.Extensions.AI --prerelease

Projects

This repo contains the following projects:

Sample apps

  • Remind Me - an app that reminds you about what you have been working on over the last few hours using Pieces Long-Term Memory.

Pieces.OS.Client Examples

There is an example project using the Pieces.OS.Client package in the ./src/Client.Example folder. This example is a console app containing a range of different examples, each commented out. To run these examples, uncomment the one you want to run, then run dotnet run from the ./src/Client.Example folder.

Details of this example project are provided in the src/Client/README.md file.

Pieces.Extensions.AI Examples

There is an example project using the Pieces.Extensions.AI package in the ./src/Extensions.Example folder. This example is a console app containing a range of different examples, each commented out. To run these examples, uncomment the one you want to run, then run dotnet run from the ./src/Extensions.Example folder.

Details of this example project are provided in the src/Extensions/README.md file.

Publish the packages

This repo includes GitHub actions to publish both the Pieces.OS.Client and Pieces.Extensions.AI packages.

The Pieces.Extensions.AI package is dependent on the Pieces.OS.Client package. The way this is implemented is:

  • In this repo, the Pieces.Extensions.AI project has a project dependency on Pieces.OS.Client and Pieces.OS.Core
  • In the action to publish, this project dependency is removed, and a nuget package dependency is added to the latest pre-release Pieces.OS.Core.

To publish these packages, do the following:

  • Tag this repo using a tag of client-v<x.y.z-a> where <x.y.z-a> is the version string. For example, to release 0.0.10-beta you would tag with client-v0.0.10-beta. This will only build and publish the Pieces.OS.Client package.
  • Once the Pieces.OS.Client package has been validated and made public on nuget, tag the repo using a tag of extensions-v<x.y.z-a>, for example extensions-v0.0.10-beta. This will build the Pieces.Extensions.AI package using the nuget package reference to Pieces.OS.Client, and publish to nuget.

About

The Pieces OS Client SDK is a powerful code engine package designed for writing applications on top of Pieces OS.

Topics

Resources

License

Stars

Watchers

Forks

Languages