This package provides a client library for interacting with WeKnora services, supporting all HTTP-based interface calls, making it easier for other modules to integrate with WeKnora services without having to write HTTP request code directly.
## Main Features
The client includes the following main functional modules:
1.**Session Management**: Create, retrieve, update, and delete sessions
2.**Knowledge Base Management**: Create, retrieve, update, and delete knowledge bases
3.**Knowledge Management**: Add, retrieve, and delete knowledge content
4.**Tenant Management**: CRUD operations for tenants
5.**Knowledge Q&A**: Supports regular Q&A and streaming Q&A
6.**Chunk Management**: Query, update, and delete knowledge chunks
7.**Message Management**: Retrieve and delete session messages
8.**Model Management**: Create, retrieve, update, and delete models
9.**Evaluation Function**: Start evaluation tasks and get evaluation results
You can set a default tenant with `WithTenantID`; the client will automatically send the `X-Tenant-ID` header:
```go
tenantID := uint64(10000)
apiClient := client.NewClient(
"http://api.example.com",
client.WithToken("your-auth-token"),
client.WithTenantID(tenantID),
)
```
If a single request needs a different tenant, set `TenantID` in the request context. The value can be a `uint64`, `*uint64`, or a numeric string, and it will take precedence over the client default: