External Pipeline Requirements

External pipeline detailed requirements

Overview

External services must implement specific requirements to be compatible with GLChat's external pipeline registration feature. This guide covers the core API endpoints, attachment handling, and conversation history support.

Key Requirements

  1. Implement /verify endpoint - For registration and metadata retrieval

  2. Implement /responses endpoint - OpenAI-compatible Responses API interface

  3. Support header authentication - For API key validation

  4. Return valid JSON responses - With required fields

  5. Support attachment handling - For file-based queries (Optional)

  6. Support conversation history --- For multi-turn conversations (Optional)

Required Endpoints

1. Service Discovery Endpoint

Endpoint: GET /verify

Purpose: Called by GLChat during pipeline registration to verify connectivity and retrieve service metadata.

Request Headers:

Header
Value
Required
Description

X-API-Key

{api_key}

Yes

API key for authentication

Response Schema:

Field Specifications:

Field
Type
Required
Description

name

string

Yes

Non-empty after stripping whitespace

version

string

Yes

Non-empty after stripping whitespace

description

string

No

Optional, string if provided

model_names

string[]

No

Optional, array of non-empty strings if provided

supports_attachments

boolean

No

Whether the pipeline accepts file attachments

supported_file_types

dict

No

File type categories with extensions

max_file_size

integer

No

Maximum file size in bytes

max_file_count

integer

No

Maximum number of files per request

circle-info

⚠️ Notes: The model names for external pipeline are currently not used in GLChat. This will be addressed as a future enhancement.

2. Responses Endpoint

Endpoint: POST /responses

Purpose: Called by GLChat during chatbot conversations to generate AI responses. Supports simple queries and multi-turn conversations with attachments.

Note:

  1. GLChat uses OpenAI's newer Responses API (not the legacy Chat Completions API).

  2. The service should support streaming modes

  3. The service /responses should mimic OpenAI Responses. Here's guides from OpenAI https://developers.openai.com/api/reference/resources/responses/methods/createarrow-up-right

Example

For example, follow instructions on External Pipeline Main Section

circle-info

⚠️ Disclaimer: The attached code is just a minimum dummy example

Last updated