{"id":26418115,"url":"https://github.com/hidayetcanozcan/vorionsdk","last_synced_at":"2026-02-03T06:01:47.016Z","repository":{"id":257781848,"uuid":"860153026","full_name":"HidayetCanOzcan/VorionSDK","owner":"HidayetCanOzcan","description":"Vorion SDK: A comprehensive TypeScript SDK for interacting with VORION RAG \u0026 LLM APIs, supporting REST interfaces with future plans for WebSocket support.","archived":false,"fork":false,"pushed_at":"2024-12-25T10:58:49.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T22:04:29.371Z","etag":null,"topics":["ai","llm","pair","rag","sdk","vorion","websockets"],"latest_commit_sha":null,"homepage":"https://github.com/HidayetCanOzcan/VorionSDK#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HidayetCanOzcan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-19T23:21:48.000Z","updated_at":"2024-12-25T10:58:52.000Z","dependencies_parsed_at":"2024-09-19T23:42:28.245Z","dependency_job_id":"e62a28af-166f-4360-bc25-004afefcc70c","html_url":"https://github.com/HidayetCanOzcan/VorionSDK","commit_stats":null,"previous_names":["hidayetcanozcan/vorionsdk"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HidayetCanOzcan%2FVorionSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HidayetCanOzcan%2FVorionSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HidayetCanOzcan%2FVorionSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HidayetCanOzcan%2FVorionSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HidayetCanOzcan","download_url":"https://codeload.github.com/HidayetCanOzcan/VorionSDK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244135886,"owners_count":20403798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","llm","pair","rag","sdk","vorion","websockets"],"created_at":"2025-03-18T01:17:01.446Z","updated_at":"2026-02-03T06:01:41.989Z","avatar_url":"https://github.com/HidayetCanOzcan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vorion SDK\n\nVorion SDK is a comprehensive TypeScript SDK for interacting with the VORION RAG \u0026 LLM APIs. It supports both REST and WebSocket interfaces and provides an extensible solution for server-side applications.\n\n## Features\n\n- Interact with VORION RAG (Retrieval-Augmented Generation) API\n- Interact with VORION LLM (Language Model) API\n- WebSocket support for real-time communication\n- TypeScript support for enhanced type safety and developer experience\n- Extensible Elysia-based server creation for server-side applications\n- Dapr integration for advanced distributed system capabilities\n- Rich type definitions for improved code quality and autocompletion\n\n## Installation\n\n```bash\nnpm install vorion-sdk\n```\n\n## Usage\n\n### Importing the SDK\n\n```typescript\nimport { VorionRAGSDK, VorionLLMSDK, VorionWebSocket, createVorionServer } from 'vorion-sdk';\n```\n\n### RAG API Usage\n\n```typescript\nconst ragSdk = new VorionRAGSDK('https://your-rag-api-base-url.com');\n\n// Example: Embedding documents\nconst embedResult = await ragSdk.embed({\n\tdocuments: ['Your document content here'],\n\tembedder_name: EmbedderOptions.Azure,\n});\n\n// Example: Ingesting documents\nconst ingestResult = await ragSdk.ingest({\n\tdata_sources: [\n\t\t{\n\t\t\ttype: 'txt',\n\t\t\ttarget: 'path/to/your/file.txt',\n\t\t\tmetadata: { subject: 'Example' },\n\t\t\tparameters: {},\n\t\t},\n\t],\n\tembedder_name: EmbedderOptions.Azure,\n\tvectorstore_name: VectorStoreOptions.Elastic,\n\tcollection_name: 'your_collection_name',\n\tpreferred_splitter_type: SplitterTypeOptions.Recursive,\n});\n\n// Example: Retrieving documents\nconst retrieveResult = await ragSdk.retrieve({\n\tembedder_name: EmbedderOptions.Azure,\n\tvectorstore_name: VectorStoreOptions.Elastic,\n\tcollection_name: 'your_collection_name',\n\tquery: 'Your search query',\n\tk: 5,\n});\n```\n\n### LLM API Usage\n\n```typescript\nconst llmSdk = new VorionLLMSDK('https://your-llm-api-base-url.com');\n\n// Example: Making a prediction\nconst predictResult = await llmSdk.predict({\n\tconversation_state_key: 'unique_conversation_id',\n\tprompt: {\n\t\ttext: 'Your prompt text here',\n\t\tsensitive_info: false,\n\t},\n\tllm_name: LLMOptions.OpenAI,\n\tllm_group_name: LLMGroupNameOptions['gpt-4'],\n\tmemory_strategy_name: MemoryStrategyOptions.FullSummarize,\n\tmemory_type: MemoryOptions.Redis,\n\tload_balancer_strategy_name: LoadBalanceStrategyOptions.DynamicWeightedRoundRobin,\n});\n\n// Example: Using Dapr for prediction\nimport { DaprClient } from '@dapr/dapr';\n\nconst daprClient = new DaprClient();\nconst predictResultWithDapr = await llmSdk.predict(\n\t{\n\t\t// ... prediction request parameters ...\n\t},\n\ttrue, // Set to true to use Dapr\n\tdaprClient\n);\n\n// Example: Using a basic AI agent\nconst agentResult = await llmSdk.agentBasic({\n\tteam_id: 'your_team_id',\n\tassistant_name: 'Assistant',\n\tassistant_sys_message: 'You are a helpful assistant.',\n\ttask: 'Your task description',\n\tconversation_state_key: 'unique_conversation_id',\n\tllm_name: LLMOptions.OpenAI,\n\tllm_group_name: LLMGroupNameOptions['gpt-4'],\n\tload_balancer_strategy_name: LoadBalanceStrategyOptions.RoundRobin,\n});\n```\n\n### WebSocket Usage\n\n```typescript\nconst socket = VorionWebSocket('wss://your-websocket-url.com', 'unique-session-id.c');\n\nsocket.on(VorionEvents.PREDICTION_COMPLETE, (payload) =\u003e {\n\tconsole.log('Prediction complete:', payload);\n});\n\nsocket.on(VorionEvents.INGEST_DOCUMENTS_SUCCEEDED, (payload) =\u003e {\n\tconsole.log('Document ingestion succeeded:', payload);\n});\n```\n\n### Server Creation\n\n```typescript\nimport { createVorionServer, DaprEvents } from 'vorion-sdk';\n\nconst { start, app } = createVorionServer({\n\tport: 3000,\n\twsServerResponses: {\n\t\t[DaprEvents.PREDICTION_COMPLETE]: async (data) =\u003e {\n\t\t\t// Handle prediction completion\n\t\t\treturn {\n\t\t\t\tevent: 'custom-prediction-event',\n\t\t\t\tpayload: { result: data.answer },\n\t\t\t};\n\t\t},\n\t\t// Other event handlers...\n\t},\n\tlistenCallback: () =\u003e {\n\t\tconsole.log('Vorion Server started');\n\t},\n});\n\n// Add custom routes or logic\napp.get('/custom-route', () =\u003e 'Custom route response');\n\n// Start the server\nstart();\n```\n\n## API Reference\n\nThe SDK provides methods corresponding to various API endpoints:\n\n### RAG SDK Methods\n\n- `embed`: Embed documents or queries\n- `aembed`: Asynchronous embedding\n- `ingest`: Ingest documents into the vector store\n- `aingest`: Asynchronous document ingestion\n- `ingestMultipart`: Ingest documents using multipart form data\n- `aingestMultipart`: Asynchronous multipart document ingestion\n- `queryIngestState`: Query the state of an ingestion task\n- `rollbackIngest`: Rollback a document ingestion\n- `load`: Load documents\n- `aload`: Asynchronous document loading\n- `retrieve`: Retrieve relevant documents\n\n### LLM SDK Methods\n\n- `predict`: Make a prediction using the LLM\n- `apredict`: Asynchronous prediction\n- `comparePredict`: Compare predictions from different models\n- `agentBasic`: Use a basic AI agent\n- `agentAbasic`: Asynchronous basic AI agent\n- `agentTeam`: Use a team of AI agents\n- `getHistory`: Retrieve conversation history\n- `getLlmConfig`: Get LLM configuration\n- `getFile`: Retrieve a specific file\n- `getAllFiles`: Retrieve all files for a conversation\n\n## Key Types and Enums\n\nThe SDK includes a rich set of types and enums for better type safety and autocompletion:\n\n### RAG Types\n\n- `EmbedRequest`, `EmbedResponse`: Types for embedding requests and responses\n- `IngestRequest`, `IngestResponse`: Types for document ingestion\n- `RetrieveRequest`, `RetrieveResponse`: Types for document retrieval\n- `LoadRequest`, `LoadResultModel`: Types for document loading\n\n### LLM Types\n\n- `PredictRequest`, `PredictResponse`: Types for LLM predictions\n- `AgentBasicRequest`, `AgentBasicResponse`: Types for basic agent interactions\n- `GetHistoryRequest`, `GetHistoryResponse`: Types for retrieving conversation history\n\n### Enums\n\n- `EmbedderOptions`: Options for embedding models (e.g., `Azure`, `OpenAI`)\n- `VectorStoreOptions`: Options for vector stores (e.g., `Redis`, `Chroma`)\n- `LLMOptions`: Options for language models (e.g., `Azure`, `OpenAI`, `Google`)\n- `LLMGroupNameOptions`: Options for LLM group names (e.g., `gpt-4`, `claude-3-5-sonnet`)\n- `LoadBalanceStrategyOptions`: Options for load balancing strategies\n- `MemoryOptions`: Options for memory types (e.g., `InMemory`, `Redis`)\n- `MemoryStrategyOptions`: Options for memory strategies (e.g., `FullSummarize`, `RemoveTop`)\n- `SplitterTypeOptions`: Options for text splitting methods\n\n### WebSocket Events\n\n- `VorionEvents`: Enum of WebSocket events (e.g., `PREDICTION_COMPLETE`, `INGEST_DOCUMENTS_SUCCEEDED`)\n\n### Server Types\n\n- `VorionServerParams`: Type for server creation parameters\n- `wsServerResponses`: Type for WebSocket server response handlers\n\n## Error Handling\n\nAll SDK methods return a promise that resolves to an object with the following structure:\n\n```typescript\n{\n  isSuccess: boolean;\n  errors?: ApiError;\n  response?: ResponseType;\n  code: number | null;\n  createdAt: Date;\n}\n```\n\nHandle potential errors by checking the `isSuccess` flag and the `errors` object.\n\n## Server Creation and Extension\n\nThe `createVorionServer` function allows you to create an Elysia-based server that can be extended to handle WebSocket events and add custom logic:\n\n```typescript\nconst { start, app } = createVorionServer({\n\tport: 3000,\n\twsServerResponses: {\n\t\t// Define event handlers here\n\t},\n});\n\n// Add custom routes or logic\napp.get('/custom-route', () =\u003e 'Custom route response');\n\n// Start the server\nstart();\n```\n\n## License\n\nThis project is licensed under the ISC License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayetcanozcan%2Fvorionsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidayetcanozcan%2Fvorionsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayetcanozcan%2Fvorionsdk/lists"}