NeuralPlus 0.2.0
A small C++17 SDK for AI clients, sessions, tools, and tracing
Loading...
Searching...
No Matches
types.hpp File Reference
#include "neuralplus/export.hpp"
#include <nlohmann/json.hpp>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  neuralplus::Content
 One text, image, audio, file, or provider-extension part. More...
 
struct  neuralplus::ToolCall
 A normalized provider-requested tool call. More...
 
struct  neuralplus::ToolSpec
 Description and JSON Schema advertised to a model. More...
 
class  neuralplus::Message
 A valid conversation message with one normalized role. More...
 
struct  neuralplus::ModelCapabilities
 Model features used for early validation and feature discovery. More...
 
struct  neuralplus::ModelDescriptor
 Data-driven model description; no C++ subclass is needed per model name. More...
 
struct  neuralplus::GenerateOptions
 Per-call generation settings shared by all providers. More...
 
struct  neuralplus::TokenUsage
 Normalized token counts. Providers may leave unavailable values empty. More...
 
struct  neuralplus::AIRequest
 Immutable snapshot passed to one provider round. More...
 
struct  neuralplus::AIResponse
 Normalized response returned by both one provider round and the full tool loop. More...
 
class  neuralplus::Error
 Base error for SDK failures. More...
 
class  neuralplus::ConfigurationError
 Invalid or missing configuration. More...
 
class  neuralplus::SessionInUseError
 A Session was already being used by another generation. More...
 
class  neuralplus::MaxRoundsError
 The configured number of provider requests was exhausted. More...
 
class  neuralplus::TransportError
 An HTTP transport could not complete a request. More...
 
class  neuralplus::ProviderError
 A provider returned an unsuccessful or malformed response. More...
 

Typedefs

using neuralplus::JsonValue = nlohmann::json
 

Enumerations

enum class  neuralplus::Provider {
  openai , anthropic , gemini , openai_compatible ,
  custom
}
 Provider family associated with a model descriptor.
 
enum class  neuralplus::Role { system , user , assistant , tool }
 Conversation role of a message.
 
enum class  neuralplus::FinishReason {
  stop , tool_calls , length , content_filter ,
  refusal , error , unknown
}
 Normalized reason why generation stopped.
 
enum class  neuralplus::ContentType {
  text , image , audio , file ,
  extension
}
 Kind of a multimodal content part.
 
enum class  neuralplus::ContentSource { value , url , bytes , provider_data }
 Storage or reference form of a content part.
 

Functions

NEURALPLUS_API const char * neuralplus::to_string (Provider provider) noexcept
 Returns the stable SDK spelling of an enum value.
 
NEURALPLUS_API const char * neuralplus::to_string (Role role) noexcept
 Returns the stable SDK spelling of an enum value.
 
NEURALPLUS_API const char * neuralplus::to_string (FinishReason reason) noexcept
 Returns the stable SDK spelling of an enum value.
 

Detailed Description

Provider-independent messages, model metadata, requests, responses, and errors.

Typedef Documentation

◆ JsonValue

using neuralplus::JsonValue = typedef nlohmann::json

JSON value used by provider options, tool schemas, and tool arguments.

See also
https://json.nlohmann.me/features/arbitrary_types/