|
OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
|
#include <RestProvider.h>
Public Member Functions | |
| RestProvider (RestProviderConfig config, std::shared_ptr< OpenAnima::Http::HttpTransport > transport) | |
| OpenAnima::Core::Completion | complete (const std::vector< OpenAnima::Core::ChatMessage > &messages, const Call &call) override |
| OpenAnima::Core::Completion | complete (const std::vector< OpenAnima::Core::ChatMessage > &messages, const DeltaSink &onDelta) |
| OpenAnima::Core::Completion | complete (const std::vector< OpenAnima::Core::ChatMessage > &messages) |
| const RestProviderConfig & | config () const noexcept |
Public Member Functions inherited from OpenAnima::Provider::IProvider | |
| IProvider (const IProvider &)=delete | |
| Providers are used through a pointer, so copying and moving are not offered. | |
| IProvider & | operator= (const IProvider &)=delete |
| IProvider (IProvider &&)=delete | |
| IProvider & | operator= (IProvider &&)=delete |
| OpenAnima::Core::Completion | complete (const std::vector< OpenAnima::Core::ChatMessage > &messages, const DeltaSink &onDelta) |
| OpenAnima::Core::Completion | complete (const std::vector< OpenAnima::Core::ChatMessage > &messages) |
Additional Inherited Members | |
Protected Member Functions inherited from OpenAnima::Provider::IProvider | |
| IProvider ()=default | |
| Only derived classes build a provider. | |
Provider for the OpenAI chat-completions contract, which is also spoken by local servers such as Ollama, llama.cpp and vLLM.
| OpenAnima::Provider::RestProvider::RestProvider | ( | RestProviderConfig | config, |
| std::shared_ptr< OpenAnima::Http::HttpTransport > | transport | ||
| ) |
Creates a provider.
| config | Endpoint, model and generation settings. |
| transport | HTTP boundary used for every call. |
|
inline |
Sends a whole conversation and waits for the answer.
| messages | Conversation in chronological order; the last entry is the current turn. |
| OpenAnimaError | subclasses when the call cannot be completed. |
References OpenAnima::Provider::IProvider::complete().
|
overridevirtual |
Sends a whole conversation and returns the answer.
The same contract as the interface, written out again because the interface has three complete members and a @copydoc cannot say which one counts.
| messages | Conversation in chronological order; the last entry is the current turn. |
| call | Where the pieces go, and how the call can be abandoned. |
| OpenAnimaError | subclasses when the call cannot be completed. |
Implements OpenAnima::Provider::IProvider.
|
inline |
Sends a whole conversation and reports the answer while it is produced.
| messages | Conversation in chronological order; the last entry is the current turn. |
| onDelta | Called with every piece of the answer as it arrives, in order. |
| OpenAnimaError | subclasses when the call cannot be completed. |
References OpenAnima::Provider::IProvider::complete().
|
inlinenoexcept |