{"id":31581067,"url":"https://github.com/motojinc25/wedx-chat-completion","last_synced_at":"2026-04-05T22:37:06.528Z","repository":{"id":314579952,"uuid":"1053874452","full_name":"motojinc25/wedx-chat-completion","owner":"motojinc25","description":"Chat Completions engine with function calling, streaming, Semantic Kernel/Azure, and full observability","archived":false,"fork":false,"pushed_at":"2025-09-13T09:45:43.000Z","size":406,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T22:36:55.391Z","etag":null,"topics":["azure-openai","chat-completion","entra-id","fastapi","function-calling","hawaii","mcp","observability","opentelemetry","oss","postgresql","python","react","semantic-kernel","streaming","typescript"],"latest_commit_sha":null,"homepage":"https://wedx.cc","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/motojinc25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-10T04:00:59.000Z","updated_at":"2025-09-19T21:16:50.000Z","dependencies_parsed_at":"2025-09-13T12:32:36.975Z","dependency_job_id":"d083682e-1a05-445d-8332-bac9ed709fb1","html_url":"https://github.com/motojinc25/wedx-chat-completion","commit_stats":null,"previous_names":["motojinc25/wedx-chat-completion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/motojinc25/wedx-chat-completion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motojinc25%2Fwedx-chat-completion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motojinc25%2Fwedx-chat-completion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motojinc25%2Fwedx-chat-completion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motojinc25%2Fwedx-chat-completion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/motojinc25","download_url":"https://codeload.github.com/motojinc25/wedx-chat-completion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motojinc25%2Fwedx-chat-completion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31452899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["azure-openai","chat-completion","entra-id","fastapi","function-calling","hawaii","mcp","observability","opentelemetry","oss","postgresql","python","react","semantic-kernel","streaming","typescript"],"created_at":"2025-10-05T21:52:49.348Z","updated_at":"2026-04-05T22:37:06.033Z","avatar_url":"https://github.com/motojinc25.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌺 WeDX Chat Completion\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e🏝️ \u003cem\u003eAloha from Hawaii\u003c/em\u003e 🏝️\u003c/h3\u003e\n  \u003cp\u003e\u003cstrong\u003eThe open-core engine powering intelligent conversations\u003c/strong\u003e\u003c/p\u003e\n\n  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n  [![React](https://img.shields.io/badge/React-18+-blue.svg)](https://react.dev/)\n  [![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com/)\n  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)\n  [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/)\n\n  *Born under the Hawaiian sun, engineered for the world* 🌴\n\u003c/div\u003e\n\n---\n\n## 🌊 Welcome to WeDX Chat Completion\n\nLike the gentle trade winds of Hawaii, **WeDX Chat Completion** brings effortless conversational AI to your applications. This open-source platform provides OpenAI Chat Completion-compatible APIs with advanced function calling, real-time streaming, and enterprise-grade security.\n\n**WeDX Chat Completion** serves as the open-core foundation that powers **[WeDX Chat Ci](https://wedx.cc)** — our comprehensive commercial AI platform. While this OSS version provides core conversational AI capabilities, WeDX Chat Ci offers enhanced enterprise features, professional support, and managed cloud services.\n\nDeveloped with the spirit of Hawaiian hospitality, our platform welcomes developers from around the world to build intelligent, interactive experiences.\n\n## ✨ Key Features\n\n### 🤖 **Intelligent Conversations**\n\n- **OpenAI-Compatible API**: Seamless integration with existing Chat Completion workflows\n- **Real-time Streaming**: Live response generation with function call detection\n- **Microsoft Semantic Kernel**: Advanced AI orchestration with Azure OpenAI\n- **Function Calling**: Math, Time, HTTP operations, and extensible MCP plugin support\n\n### 🔒 **Enterprise Security**\n\n- **Microsoft Entra ID**: Enterprise-grade authentication and authorization\n- **JWT Token Validation**: Secure API access with automatic token verification\n- **Audit Logging**: Comprehensive tracking of user actions and system events\n- **Multi-mode Support**: Development, Production, and Demo modes\n\n### 🏗️ **Modern Architecture**\n\n- **Function-First Design**: Domain-driven architecture for scalability\n- **Full-Stack TypeScript**: End-to-end type safety\n- **PostgreSQL**: Robust database with automatic migrations\n- **OpenTelemetry**: Complete observability with traces, logs, and metrics\n\n### 🎨 **Developer Experience**\n\n- **React 18+ Frontend**: Modern UI with Shadcn/UI components\n- **FastAPI Backend**: High-performance Python API server\n- **Code Quality**: ESLint, Biome, and Ruff for consistent code standards\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+ and pnpm\n- Python 3.11+ and uv\n- PostgreSQL 13+\n- Azure OpenAI Service (for AI features)\n- Microsoft Entra ID App Registration (for authentication)\n\n### 🏃‍♂️ Get Running in 5 Minutes\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/motojinc25/wedx-chat-completion.git\ncd wedx-chat-completion\n\n# 2. Install dependencies\ncd frontend \u0026\u0026 pnpm install\ncd ../backend \u0026\u0026 uv sync\n\n# 3. Set up environment variables\ncp frontend/.env.example frontend/.env\ncp backend/.env.example backend/.env\n# Edit .env files with your configurations\n\n# 4. Initialize database\ncd backend \u0026\u0026 uv run alembic upgrade head\n\n# 5. Start both services\ncd frontend \u0026\u0026 pnpm run dev:full\n```\n\nYour services will be running at:\n- **Frontend**: http://localhost:5173\n- **Backend API**: http://localhost:8000\n- **API Docs**: http://localhost:8000/docs\n\n## 🏗️ Architecture Overview\n\nWeDX Chat Completion follows a **Function-First** architecture, organizing code by business capabilities rather than technical layers.\n\n### Frontend Structure\n\n```\nfrontend/src/\n├── features/                    # Business features\n│   ├── administration/          # User \u0026 tenant management\n│   ├── dashboard/               # Monitoring dashboards\n│   ├── data-management/         # Master data \u0026 settings\n│   ├── observability/           # Logs, traces, metrics\n│   └── playground/              # Chat interface\n├── shared/                      # Shared components\n│   ├── components/ui/           # Shadcn/UI components\n│   ├── contexts/                # React contexts\n│   ├── hooks/                   # Global hooks\n│   └── utils/                   # Utilities \u0026 API client\n```\n\n### Backend Structure\n\n```\nbackend/\n├── features/                    # Business features\n│   ├── administration/          # User management APIs\n│   ├── dashboard/               # System monitoring\n│   ├── data_management/         # Configuration APIs\n│   ├── observability/           # Telemetry endpoints\n│   └── playground/              # Chat completion APIs\n├── shared/                      # Shared infrastructure\n│   ├── auth/                    # Authentication \u0026 JIT provisioning\n│   ├── database/                # PostgreSQL connection\n│   ├── models/                  # SQLAlchemy models\n│   └── utils/                   # Common utilities\n```\n\n## 🔧 Development Commands\n\n### Frontend Development\n\n```bash\ncd frontend\n\n# Development server\npnpm run dev              # Start frontend only\npnpm run dev:full         # Start both frontend \u0026 backend\n\n# Build \u0026 Quality\npnpm run build           # Production build\npnpm run check           # Lint \u0026 format (Biome)\npnpm run test:run        # Run tests once\npnpm run test            # Test watch mode\n```\n\n### Backend Development\n\n```bash\ncd backend\n\n# Development server\nuv run python main.py    # Start backend with logging\n\n# Database\nuv run alembic revision --autogenerate -m \"Description\"\nuv run alembic upgrade head\n\n# Quality \u0026 Testing\ncd frontend \u0026\u0026 pnpm run check:backend    # Lint \u0026 format (Ruff)\ncd frontend \u0026\u0026 pnpm run test:backend     # Run pytest tests\n```\n\n## 🌐 API Usage\n\n### Chat Completion Endpoint\n\n```bash\ncurl -X POST \"http://localhost:8000/api/ai/chat/completion\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Calculate 15 + 27\"}\n    ],\n    \"system_message\": \"You are a helpful assistant.\"\n  }'\n```\n\n### Function Calling Response\n\n```json\n{\n  \"content\": \"I'll calculate that for you.\",\n  \"function_calls\": [\n    {\n      \"name\": \"Math-Add\",\n      \"arguments\": {\"value1\": 15, \"value2\": 27},\n      \"result\": 42\n    }\n  ],\n  \"finish_reason\": \"tool_calls\",\n  \"role\": \"assistant\"\n}\n```\n\n## 🔌 Plugin System\n\nExtend functionality with plugins:\n\n### Core Plugins (Built-in)\n\n- **Math Plugin**: Mathematical calculations\n- **Time Plugin**: Current time and date functions\n- **HTTP Plugin**: Web requests and interactions\n\n### MCP Plugins (External Tools)\n\n- **Context7 Plugin**: Documentation resolver\n- **Custom MCP Plugins**: Extensible external tool integration\n\n## 📊 Observability\n\nBuilt-in comprehensive monitoring:\n\n- **OpenTelemetry Integration**: Traces, logs, and metrics\n- **PostgreSQL Storage**: Direct database storage for telemetry data\n- **Semantic Kernel Telemetry**: AI operation monitoring\n- **Audit Logging**: Complete user action tracking\n- **Performance Metrics**: Response times and resource usage\n\n## 🧪 Testing\n\n### Frontend Testing (Vitest + RTL)\n\n```bash\ncd frontend\npnpm run test:run      # Run all tests\npnpm run test:ui       # Interactive test runner\npnpm run test          # Watch mode\n```\n\n### Backend Testing (pytest)\n\n```bash\ncd frontend\npnpm run test:backend  # Run all backend tests\n\n# Direct pytest (from backend directory)\ncd backend \u0026\u0026 uv run pytest -v\n```\n\n## 🤝 Contributing\n\nWe welcome contributions with the spirit of Hawaiian aloha!\n\n1. **Fork the repository**\n2. **Create a feature branch**: `git checkout -b feature/amazing-feature`\n3. **Follow our patterns**: Use Function-First architecture\n4. **Test your changes**: Ensure all tests pass\n5. **Submit a PR**: Include clear description and tests\n\n### Development Guidelines\n\n- Follow existing code patterns and architecture\n- Add tests for new features\n- Update documentation as needed\n- Use conventional commit messages\n- Ensure linting passes (`pnpm run check`)\n\n## 📝 Environment Configuration\n\n### Frontend (.env)\n\n```bash\nVITE_APP_MODE=development                    # development/production/demo\nVITE_AZURE_CLIENT_ID=your-client-id-here\nVITE_AZURE_TENANT_ID=your-tenant-id-here\nVITE_REDIRECT_URI=http://localhost:5173\n```\n\n### Backend (.env)\n\n```bash\nAPP_MODE=development                         # development/production/demo\nAZURE_TENANT_ID=your-tenant-id-here\nAZURE_CLIENT_ID=your-client-id-here\nAZURE_API_CLIENT_ID=your-api-client-id-here\n\n# Azure OpenAI (for AI features)\nAZURE_OPENAI_API_KEY=your-api-key-here\nAZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/\nAZURE_OPENAI_CHAT_DEPLOYMENT=gpt-4\n\n# PostgreSQL\nDB_HOST=localhost\nDB_PORT=5432\nDB_NAME=admin_db\nDB_USER=admin_user\nDB_PASSWORD=admin_password\n```\n\n## 🏆 Technology Stack\n\n### Frontend\n\n- **React 18+** with TypeScript\n- **Next.js** App Router pattern\n- **Vite** for lightning-fast builds\n- **Tailwind CSS** + **Shadcn/UI**\n- **MSAL.js** for Microsoft authentication\n- **Vitest** + **React Testing Library**\n\n### Backend\n\n- **FastAPI** for high-performance APIs\n- **SQLAlchemy** async ORM + **Alembic** migrations\n- **PostgreSQL** for robust data storage\n- **Microsoft Semantic Kernel** for AI orchestration\n- **OpenTelemetry** for comprehensive observability\n- **pytest** for thorough testing\n\n## 🌺 The Hawaiian Connection\n\nDeveloped with aloha in the beautiful islands of Hawaii, this project embodies the Hawaiian values of:\n\n- **Ohana** (Family): Building a welcoming community of developers\n- **Malama** (Care): Thoughtful, sustainable code practices\n- **Pono** (Rightness): Ethical AI development and responsible technology\n- **Aloha** (Love \u0026 Respect): Inclusive, collaborative development culture\n\nLike the diverse ecosystem of Hawaii, our platform brings together various technologies in harmony to create something beautiful and functional.\n\n## 🏖️ License\n\nLicensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n## 🤙 Acknowledgments\n\n- **Microsoft** for Semantic Kernel and Azure OpenAI services\n- **OpenAI** for inspiring our Chat Completion compatibility\n- **The open-source community** for the amazing tools that make this possible\n- **Hawaii** for providing the perfect environment to innovate and create\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e🌴 Mahalo for using WeDX Chat Completion! 🌴\u003c/h3\u003e\n  \u003cp\u003e\u003cem\u003eMade with aloha in Hawaii 🏝️\u003c/em\u003e\u003c/p\u003e\n\n  **[⭐ Star us on GitHub](https://github.com/motojinc25/wedx-chat-completion)** • **[🐛 Report Issues](https://github.com/motojinc25/wedx-chat-completion/issues)**\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotojinc25%2Fwedx-chat-completion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmotojinc25%2Fwedx-chat-completion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotojinc25%2Fwedx-chat-completion/lists"}