HypernodesClient 1.0.1

dotnet add package HypernodesClient --version 1.0.1                
NuGet\Install-Package HypernodesClient -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HypernodesClient" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HypernodesClient --version 1.0.1                
#r "nuget: HypernodesClient, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HypernodesClient as a Cake Addin
#addin nuget:?package=HypernodesClient&version=1.0.1

// Install HypernodesClient as a Cake Tool
#tool nuget:?package=HypernodesClient&version=1.0.1                

HypernodesCSharpClient

Hyperthetical Client Library

A client library for interacting with the Hyperthetical API, allowing users to communicate with various graphs, manage client functions, and handle user interactions seamlessly.

Table of Contents

  1. Installation
  2. Quick Start
  3. Usage
  4. Examples
  5. Contributing
  6. License

Installation

Before you can use the Hyperthetical library, you need to install it. Add the NuGet package to your project:

# Use the following command to install the package
dotnet add package HypernodesClient

If you don't have access to NuGet, you can copy the C# files in this directory directly into your project. This will be more fragile to future changes though.

Quick Start

// Initialize the client with your funding key
var client = new Hyperthetical.Client("YOUR_FUNDING_KEY");

// Create a new user
var user = new Hyperthetical.User(client);

// Set the graph for the user
await user.SetGraphAsync("GRAPH_NAME", "GRAPH_USERNAME");

// Chat with the graph
var response = await user.ChatAsync(new List<string> { "Hello, Hyperthetical!" });
Console.WriteLine(response);

Usage

Client

The Client class is the primary point of interaction. It manages the base URL, the funding key, and client functions.

var client = new Hyperthetical.Client("YOUR_FUNDING_KEY");

You can add custom client functions to the client:

client.AddClientFunction("functionName", function);

User

For each interaction, a separate User object should be created. This helps in managing session data, the graph a user is communicating with, and other attributes.

var user = new Hyperthetical.User(client);

The User class provides methods to run graphs, chat with them, and fetch available graphs.

RunGraphRequest and RunGraphResponse

These classes help in sending requests to run specific graphs and process the responses received.

Other Models

There are other models like ClientFunction, GraphNodeData, KeyData, etc., that help in various functionalities and interactions within the library.

Examples

Here are some more detailed examples:

Example 1: Fetching Available Graphs

var availableGraphs = await user.GetAvailableGraphsAsync();
foreach(var graph in availableGraphs)
{
    Console.WriteLine(graph.Name + ": " + graph.Description);
}

Example 2: Custom Client Function

void MyCustomFunction(List<List<string>> args, Hyperthetical.User user)
{
    // Your custom code here
}
client.AddClientFunction("MyFunction", MyCustomFunction);

Contributing

We welcome contributions! Contact me at xo@hyperthetical.dev if you want to ask about a contribution, otherwise just make a pull request.

License

MIT License


For detailed documentation, please refer to the official Hyperthetical docs.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 148 9/22/2023
1.0.0 111 9/21/2023