Documentation
¶
Overview ¶
Package praixis is the top-level entry point for the Praixis Go SDK.
Create a client with your server URL and API key, then access the Chat and RAG sub-clients directly:
client := praixis.New("http://localhost:8080", "praixis_your_key")
// streaming chat
stream, err := client.Chat.Stream(ctx, chat.Request{Prompt: "Hello"})
// RAG question
stream, err := client.RAG.Ask(ctx, rag.QuestionRequest{
CollectionName: "docs",
Question: "What is the refund policy?",
})
Index ¶
Constants ¶
const DefaultTimeout = 30 * time.Second
DefaultTimeout is the HTTP request timeout applied to non-streaming requests. Streaming endpoints are not subject to this timeout; use context.Context instead.
Variables ¶
This section is empty.
Functions ¶
func IsGPUBusy ¶
IsGPUBusy reports whether err is a 503 response, meaning the server's GPU slots are exhausted. Retry after a short delay.
func IsNotFound ¶ added in v0.3.1
IsNotFound reports whether err is a 404 response — a collection, file, or session that does not exist (or belongs to another app).
func IsRateLimit ¶
IsRateLimit reports whether err is a 429 Too Many Requests response.
func IsUnauthorized ¶
IsUnauthorized reports whether err is a 401 or 403 response, usually meaning the API key is missing or invalid.
Types ¶
type APIError ¶
APIError is returned for any non-2xx HTTP response. It carries the HTTP status code and the server's error message. Use errors.As to extract it, or the IsGPUBusy / IsRateLimit / IsUnauthorized / IsNotFound helpers to test for common cases.
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
chat_stream
command
chat_stream demonstrates streaming a single-turn chat request.
|
chat_stream demonstrates streaming a single-turn chat request. |
|
rag_ask
command
rag_ask demonstrates asking a question against a RAG collection.
|
rag_ask demonstrates asking a question against a RAG collection. |
|
rag_upload
command
rag_upload demonstrates uploading a file into a RAG collection.
|
rag_upload demonstrates uploading a file into a RAG collection. |
|
Package chat provides a client for the Praixis chat and file-summary endpoints.
|
Package chat provides a client for the Praixis chat and file-summary endpoints. |
|
Package internal provides the low-level HTTP and stream-parsing primitives shared across all SDK resource clients.
|
Package internal provides the low-level HTTP and stream-parsing primitives shared across all SDK resource clients. |
|
Package rag provides a client for the Praixis RAG (retrieval-augmented generation) and vector-store endpoints.
|
Package rag provides a client for the Praixis RAG (retrieval-augmented generation) and vector-store endpoints. |