|
3 | 3 | [](https://badge.fury.io/js/%40lazydynamics%2Frxinfer-client)
|
4 | 4 | [](https://opensource.org/licenses/MIT)
|
5 | 5 |
|
6 |
| -A TypeScript SDK for interacting with RxInferServer, providing type-safe access to all server endpoints and features. |
| 6 | +A TypeScript client for interacting with RxInferServer, providing type-safe access to its API endpoints. |
| 7 | + |
| 8 | +## About RxInferServer |
| 9 | + |
| 10 | +RxInferServer is a Julia-based server that provides an API for performing probabilistic inference using the RxInfer.jl package. This client library allows you to interact with RxInferServer from TypeScript/JavaScript applications. |
| 11 | + |
| 12 | +### Key Features of RxInferServer |
| 13 | +- Probabilistic inference using message passing |
| 14 | +- Support for various probabilistic models |
| 15 | +- RESTful API interface |
| 16 | +- Real-time inference capabilities |
7 | 17 |
|
8 | 18 | ## Installation
|
9 | 19 |
|
10 | 20 | ```bash
|
11 | 21 | npm install @lazydynamics/rxinfer-client
|
12 | 22 | ```
|
13 | 23 |
|
14 |
| -## Documentation |
| 24 | +## Usage |
| 25 | + |
| 26 | +```typescript |
| 27 | +import { RxInferClient, pingServer } from '@lazydynamics/rxinfer-client'; |
15 | 28 |
|
16 |
| -For detailed documentation and getting started guide, please visit our [official documentation](https://lazydynamics.github.io/RxInferClient.js/). |
| 29 | +// Create a client instance |
| 30 | +const client = await RxInferClient.create(); |
17 | 31 |
|
18 |
| -The documentation includes: |
19 |
| -- Getting Started Guide |
20 |
| -- API Reference |
21 |
| -- Examples and Use Cases |
22 |
| -- Best Practices |
23 |
| -- Troubleshooting |
| 32 | +// Use the client to interact with RxInferServer |
| 33 | +const response = await pingServer({ client }); |
| 34 | +console.log(response.data); // { status: 'ok' } |
| 35 | +``` |
24 | 36 |
|
25 | 37 | ## Development
|
26 | 38 |
|
27 |
| -For information about developing this package, please see our [Contributing Guide](CONTRIBUTING.md). |
| 39 | +### Prerequisites |
| 40 | +- Node.js (LTS version recommended) |
| 41 | +- RxInferServer running locally or accessible via network |
| 42 | + |
| 43 | +### Setting up RxInferServer |
| 44 | +1. Clone the RxInferServer repository: |
| 45 | + ```bash |
| 46 | + git clone https://github.com/lazydynamics/RxInferServer.git |
| 47 | + cd RxInferServer |
| 48 | + ``` |
| 49 | + |
| 50 | +2. Build and start the server: |
| 51 | + ```bash |
| 52 | + make docker |
| 53 | + make dev |
| 54 | + ``` |
| 55 | + |
| 56 | + This will start RxInferServer on `http://localhost:8000`. |
| 57 | + |
| 58 | +### Building the Client |
| 59 | +1. Install dependencies: |
| 60 | + ```bash |
| 61 | + npm install |
| 62 | + ``` |
| 63 | + |
| 64 | +2. Generate TypeScript client from OpenAPI specification: |
| 65 | + ```bash |
| 66 | + npm run generate |
| 67 | + ``` |
| 68 | + |
| 69 | +3. Build the package: |
| 70 | + ```bash |
| 71 | + npm run build |
| 72 | + ``` |
| 73 | + |
| 74 | +### Running Tests |
| 75 | +```bash |
| 76 | +npm test |
| 77 | +``` |
| 78 | + |
| 79 | +Note: Tests require RxInferServer to be running locally. |
| 80 | + |
| 81 | +## Documentation |
| 82 | + |
| 83 | +Generate and view documentation: |
| 84 | +```bash |
| 85 | +npm run docs |
| 86 | +npm run docs:serve |
| 87 | +``` |
| 88 | + |
| 89 | +## Contributing |
| 90 | + |
| 91 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project. |
28 | 92 |
|
29 | 93 | ## License
|
30 | 94 |
|
|
0 commit comments