{"id":41235902,"url":"https://github.com/inkeep/inkeep-chat-api-examples","last_synced_at":"2026-01-23T01:03:29.023Z","repository":{"id":252206412,"uuid":"833236515","full_name":"inkeep/inkeep-chat-api-examples","owner":"inkeep","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-14T14:21:33.000Z","size":192,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-03T08:28:07.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inkeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-24T16:12:45.000Z","updated_at":"2025-08-14T14:21:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d2f649e-d954-4c4c-82d9-de377f2a8494","html_url":"https://github.com/inkeep/inkeep-chat-api-examples","commit_stats":null,"previous_names":["inkeep/inkeep-chat-api-examples"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/inkeep/inkeep-chat-api-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-chat-api-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-chat-api-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-chat-api-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-chat-api-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inkeep","download_url":"https://codeload.github.com/inkeep/inkeep-chat-api-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-chat-api-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: 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":[],"created_at":"2026-01-23T01:03:28.349Z","updated_at":"2026-01-23T01:03:28.998Z","avatar_url":"https://github.com/inkeep.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI Provide Links Example\n\n## Getting Started\n\n1. Clone the repository:\n\n   ```sh\n   git clone \u003crepository_url\u003e\n   cd examples/qa-mode/openai-node-sdk\n   ```\n\n2. Install the dependencies:\n\n   ```sh\n   npm install\n   ```\n\n#### Prerequisites\n\n- Node.js v22.3.0 or higher\n- npm (Node Package Manager)\n\n## OpenAI Node SDK Example\n\nThis is an example project demonstrating the use of the OpenAI Node SDK with TypeScript.\n\n1. Set your OpenAI API key in `index.ts`:\n\n   ```typescript\n   const client = new OpenAI({\n     baseURL: \"https://api.inkeep.com/v1/\",\n     apiKey: \"YOUR_API_KEY\",\n     // dangerouslyAllowBrowser: true, // use this setting if you are using this in browser\n   });\n   ```\n\n2. Run the project:\n\n   ```sh\n   npm start\n   ```\n\n## Vercel AI SDK Example\n\nThis is an example project demonstrating the use of the Vercel AI SDK with TypeScript.\n\n1. Set your OpenAI API key in `index.ts`:\n\n   ```typescript\n   const openai = createOpenAI({\n     baseURL: \"https://api.inkeep.com/v1/\",\n     apiKey: \"YOUR_API_KEY\",\n   });\n   ```\n\n2. Run the project:\n\n   ```sh\n   npm start\n   ```\n\n## Project Structure\n\n## qa-mode\n\nThe `qa` models are specifically tailored for customer-facing support bot scenarios. More information in our [docs](https://docs.inkeep.com/ai-api/openai-chat-completion-endpoint#question-answer-qa-mode).\n\n### openai-node-sdk-qa\n\n- `index.ts`: Main entry point of the application. It demonstrates how to use the OpenAI Node SDK to create a chat completion and handle tools.\n- `LinksToolSchema.ts`: Contains Zod schemas used for validating data structures.\n\n### vercel-ai-sdk-qa\n\nOpen localhost:3000 to see a basic AI application that uses Vercel AI SDK. These examples show how to set up the `provideLinks` tool call, and how to stream the response to the client.\n\n#### Route handler implementation\n\n- `app/api/chat/route.ts`: Route handler implementation for the chat endpoint.\n- `app/useChat/page.tsx`: Page implementation that uses `useChat` to stream a response from the server. Go to localhost:3000/useChat to see the page.\n\n#### React Server Component implementation\n\n- `components/chat.tsx`: Chat client component that renders the response messages that are streamed from the server. This also has a form that calls `submitUserMessage` with the form's input value.\n- `lib/chat/actions.tsx`: `submitUserMessage` calls `streamUI` with relevant configuration to stream the response to the client and handle tool calling.\n- `inkeep-qa-schema.ts`: Contains Zod schemas used for validating data structures.\n\n## contextual-mode\n\nThese examples show how to set up the API calls that use Inkeep's contextual mode, and how to stream a structured JSON response to the client. More information regarding Inkeep's contextual mode can be found in our [docs](https://docs.inkeep.com/ai-api/openai-chat-completion-endpoint#contextual-mode).\n\n### vercel-ai-sdk\n\n- `index.ts`: Main entry point of the application.\n- `LinksToolSchema.ts`: Contains Zod schemas used for validating data structures.\n\n## Dependencies\n\n- `openai`: OpenAI's official Node.js client.\n\n- `@ai-sdk/openai`: SDK for interacting with OpenAI's API.\n- `ai`: Library for AI tools.\n- `openai`: OpenAI's official Node.js client.\n- `zod`: TypeScript-first schema declaration and validation library.\n\n### Development Dependencies\n\n- `tsx`: TypeScript execution environment.\n\n- `typescript`: TypeScript language.\n\n## rag-mode\n\nThe `rag` mode provides structured RAG (Retrieval-Augmented Generation) documents from Inkeep's knowledge base. This mode returns a structured response containing an array of documents with context, source information, and URLs.\n\n### openai-node-sdk\n\n- `index.ts`: Script that demonstrates how to use the OpenAI Node SDK to create a structured output parsing request for RAG documents.\n- Uses Zod schemas for validating the RAG response structure.\n- Includes comprehensive error handling and response validation.\n\n### vercel-ai-sdk\n\n- `index.ts`: Script that demonstrates how to use raw fetch to retrieve and validate RAG documents.\n- Uses Zod schemas for validating the response structure.\n- Includes comprehensive error handling and response validation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Finkeep-chat-api-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finkeep%2Finkeep-chat-api-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Finkeep-chat-api-examples/lists"}