Go SDK
Installation
Requirements
- Go 1.18 or higher
- No external dependencies beyond the standard library
Quick Start
Authentication
Get your API key from your Plugged.in Profile:Core Features
Document Management
List Documents
Get Document
Search Documents
Create AI-Generated Document
Update Document
Delete Document
RAG Operations
Simple Query
Query with Sources
Find Relevant Documents
File Uploads
Upload Single File
Upload from Reader
Batch Upload
Error Handling
The SDK provides typed error structs for comprehensive error handling:Context and Cancellation
All SDK methods accept a context for cancellation and timeout control:Concurrent Operations
Leverage Go’s concurrency for parallel operations:Testing
Unit Testing with Interfaces
Integration Testing
Benchmarking
Advanced Configuration
Custom HTTP Transport
Environment Variables
Rate Limiting
The SDK handles rate limiting automatically:- API Endpoints: 60 requests per minute
- Document Search: 10 requests per hour for AI documents
- RAG Queries: Subject to plan limits
Examples
Complete working examples are available in the GitHub repository:API Reference
Client Functions
Function | Description |
---|---|
NewClient(apiKey) | Create a new client with default settings |
NewClientWithOptions(apiKey, baseURL, httpClient) | Create a client with custom options |
Client Methods
Method | Description |
---|---|
SetAPIKey(apiKey) | Update the API key |
SetBaseURL(baseURL) | Update the base URL |
Document Service Methods
Method | Description |
---|---|
List(ctx, filters) | List documents with optional filters |
Get(ctx, id, includeContent, includeVersions) | Get a specific document |
Search(ctx, query, filters, limit, offset) | Search documents |
Create(ctx, request) | Create a new document |
Update(ctx, id, request) | Update an existing document |
Delete(ctx, id) | Delete a document |
RAG Service Methods
Method | Description |
---|---|
AskQuestion(ctx, query) | Simple RAG query |
QueryWithSources(ctx, query, projectUUID) | Query with source documents |
FindRelevantDocuments(ctx, query, projectUUID, limit) | Find relevant documents |
CheckAvailability(ctx) | Check RAG service availability |
GetStorageStats(ctx) | Get storage statistics |
Upload Service Methods
Method | Description |
---|---|
UploadFile(ctx, path, metadata, onProgress) | Upload file from path |
UploadReader(ctx, reader, size, metadata, onProgress) | Upload from io.Reader |
UploadBatch(ctx, files, onProgress) | Upload multiple files |
TrackUpload(ctx, uploadID, onUpdate) | Track upload processing |
Support
- Go Package: https://pkg.go.dev/github.com/veriteknik/pluggedinkit-go
- GitHub Issues: Report bugs and request features
- Documentation: https://docs.plugged.in
- Discord: Join our community