From afab1991c3e73a8840c15cae4d1c97596cfb0eb0 Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Mon, 17 Feb 2025 17:34:07 +0530 Subject: [PATCH 1/4] add assist prompt runner --- api-reference/assist/healthcheck.mdx | 3 + api-reference/assist/prompt/chat_stream.mdx | 3 + api-reference/assist/prompt/prompt_stream.mdx | 3 + api-reference/assist/prompt/run_prompt.mdx | 3 + api-reference/assist/references.yaml | 194 ++++++++++++++++++ mint.json | 14 ++ 6 files changed, 220 insertions(+) create mode 100644 api-reference/assist/healthcheck.mdx create mode 100644 api-reference/assist/prompt/chat_stream.mdx create mode 100644 api-reference/assist/prompt/prompt_stream.mdx create mode 100644 api-reference/assist/prompt/run_prompt.mdx create mode 100644 api-reference/assist/references.yaml diff --git a/api-reference/assist/healthcheck.mdx b/api-reference/assist/healthcheck.mdx new file mode 100644 index 00000000..faaffc53 --- /dev/null +++ b/api-reference/assist/healthcheck.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /healthcheck +--- \ No newline at end of file diff --git a/api-reference/assist/prompt/chat_stream.mdx b/api-reference/assist/prompt/chat_stream.mdx new file mode 100644 index 00000000..a9dc09e9 --- /dev/null +++ b/api-reference/assist/prompt/chat_stream.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /prompt_runner/v1/run_chat_stream +--- \ No newline at end of file diff --git a/api-reference/assist/prompt/prompt_stream.mdx b/api-reference/assist/prompt/prompt_stream.mdx new file mode 100644 index 00000000..a67116d3 --- /dev/null +++ b/api-reference/assist/prompt/prompt_stream.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /prompt_runner/v1/run_prompt_stream +--- \ No newline at end of file diff --git a/api-reference/assist/prompt/run_prompt.mdx b/api-reference/assist/prompt/run_prompt.mdx new file mode 100644 index 00000000..b53c16f5 --- /dev/null +++ b/api-reference/assist/prompt/run_prompt.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /prompt_runner/v1/run_prompt +--- \ No newline at end of file diff --git a/api-reference/assist/references.yaml b/api-reference/assist/references.yaml new file mode 100644 index 00000000..9b84edbf --- /dev/null +++ b/api-reference/assist/references.yaml @@ -0,0 +1,194 @@ +openapi: 3.1.0 +info: + title: Lucid + description: Lucid - Prompt runner + LLM stream chat + version: 0.0.1 +servers: +- url: http://127.0.0.1:9999 + description: Local Development +- url: https://api.dev.eka.care + description: Staging Server +- url: https://api.eka.care + description: Production Server +paths: + /healthcheck: + get: + summary: Healthcheck + operationId: healthcheck_healthcheck_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + /prompt_runner/v1/run_prompt_stream: + post: + summary: Run Prompt Stream + description: Run a prompt with streaming response + operationId: run_prompt_stream_prompt_runner_v1_run_prompt_stream_post + parameters: + - name: jwt-payload + in: header + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Jwt-Payload + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunPromptStreamRequest' + responses: + '200': + description: Successful Response + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /prompt_runner/v1/run_chat_stream: + post: + summary: Run Chat Stream + description: Run a prompt with streaming response + operationId: run_chat_stream_prompt_runner_v1_run_chat_stream_post + parameters: + - name: jwt-payload + in: header + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Jwt-Payload + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunPromptStreamRequest' + responses: + '200': + description: Successful Response + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /prompt_runner/v1/run_prompt: + post: + summary: Run Prompt + description: Run a prompt with streaming response + operationId: run_prompt_prompt_runner_v1_run_prompt_post + parameters: + - name: jwt-payload + in: header + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Jwt-Payload + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunPromptStreamRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' +components: + schemas: + HTTPValidationError: + properties: + detail: + items: + $ref: '#/components/schemas/ValidationError' + type: array + title: Detail + type: object + title: HTTPValidationError + RunPromptStreamRequest: + properties: + prompt_id: + type: string + title: Prompt Id + system_prompt_id: + type: string + title: System Prompt Id + input_variables: + anyOf: + - type: object + - type: 'null' + title: Input Variables + messages: + anyOf: + - type: object + - type: 'null' + title: Messages + model: + type: string + title: Model + use_patient_data: + type: boolean + title: Use Patient Data + default: false + data_source: + type: string + title: Data Source + default: doctool + temperature: + type: number + title: Temperature + default: 0.0 + pt_oid: + anyOf: + - type: string + - type: 'null' + title: Pt Oid + ipd_id: + anyOf: + - type: string + - type: 'null' + title: Ipd Id + type: object + required: + - prompt_id + - system_prompt_id + - model + title: RunPromptStreamRequest + ValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + type: array + title: Location + msg: + type: string + title: Message + type: + type: string + title: Error Type + type: object + required: + - loc + - msg + - type + title: ValidationError diff --git a/mint.json b/mint.json index c56476fa..7934042c 100644 --- a/mint.json +++ b/mint.json @@ -545,6 +545,20 @@ ] } ] + }, + { + "group": "Doc Assist", + "pages": [ + { + "group": "Prompt runner", + "pages": [ + "api-reference/assist/healthcheck", + "api-reference/assist/prompt/chat_stream", + "api-reference/assist/prompt/prompt_stream", + "api-reference/assist/prompt/run_prompt" + ] + } + ] } ], "footerSocials": { From 7583a43a77ce4ee49c90053aea47b0bd74a59973 Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Mon, 17 Feb 2025 19:16:26 +0530 Subject: [PATCH 2/4] add doc chat stream --- api-reference/assist/healthcheck.mdx | 3 --- api-reference/assist/llm/chat.mdx | 3 +++ mint.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 api-reference/assist/healthcheck.mdx create mode 100644 api-reference/assist/llm/chat.mdx diff --git a/api-reference/assist/healthcheck.mdx b/api-reference/assist/healthcheck.mdx deleted file mode 100644 index faaffc53..00000000 --- a/api-reference/assist/healthcheck.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: get /healthcheck ---- \ No newline at end of file diff --git a/api-reference/assist/llm/chat.mdx b/api-reference/assist/llm/chat.mdx new file mode 100644 index 00000000..53c7681d --- /dev/null +++ b/api-reference/assist/llm/chat.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /llm_router/v1/chat +--- \ No newline at end of file diff --git a/mint.json b/mint.json index 7934042c..26086a9b 100644 --- a/mint.json +++ b/mint.json @@ -552,10 +552,10 @@ { "group": "Prompt runner", "pages": [ - "api-reference/assist/healthcheck", "api-reference/assist/prompt/chat_stream", "api-reference/assist/prompt/prompt_stream", - "api-reference/assist/prompt/run_prompt" + "api-reference/assist/prompt/run_prompt", + "api-reference/assist/llm/chat" ] } ] From 7eaf821b75263fc89f3999ad30d7e9a055cbff54 Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Mon, 17 Feb 2025 19:16:33 +0530 Subject: [PATCH 3/4] modify yaml --- api-reference/assist/references.yaml | 56 ++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/api-reference/assist/references.yaml b/api-reference/assist/references.yaml index 9b84edbf..b77abc1e 100644 --- a/api-reference/assist/references.yaml +++ b/api-reference/assist/references.yaml @@ -11,30 +11,20 @@ servers: - url: https://api.eka.care description: Production Server paths: - /healthcheck: - get: - summary: Healthcheck - operationId: healthcheck_healthcheck_get - responses: - '200': - description: Successful Response - content: - application/json: - schema: {} /prompt_runner/v1/run_prompt_stream: post: summary: Run Prompt Stream description: Run a prompt with streaming response operationId: run_prompt_stream_prompt_runner_v1_run_prompt_stream_post parameters: - - name: jwt-payload + - name: Authorization in: header required: false schema: anyOf: - type: string - type: 'null' - title: Jwt-Payload + title: Authorization requestBody: required: true content: @@ -56,14 +46,14 @@ paths: description: Run a prompt with streaming response operationId: run_chat_stream_prompt_runner_v1_run_chat_stream_post parameters: - - name: jwt-payload + - name: Authorization in: header required: false schema: anyOf: - type: string - type: 'null' - title: Jwt-Payload + title: Authorization requestBody: required: true content: @@ -85,14 +75,14 @@ paths: description: Run a prompt with streaming response operationId: run_prompt_prompt_runner_v1_run_prompt_post parameters: - - name: jwt-payload + - name: Authorization in: header required: false schema: anyOf: - type: string - type: 'null' - title: Jwt-Payload + title: Authorization requestBody: required: true content: @@ -111,6 +101,40 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /llm_router/v1/chat: + post: + summary: Stream Chat + operationId: stream_chat_llm_router_v1_chat_post + parameters: + - name: session_id + in: query + required: true + schema: + type: string + title: Session Id + - name: model_id + in: query + required: false + schema: + default: anthropic.claude-3-5-sonnet-20241022-v2:0 + title: Model Id + - name: Authorization + in: header + required: false + schema: + anyOf: + - type: string + - type: 'null' + title: Authorization + responses: + '200': + description: Successful Response + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' components: schemas: HTTPValidationError: From feab59eaccb1395c3208e220575b57a2e2f3c14c Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Wed, 19 Feb 2025 19:40:51 +0530 Subject: [PATCH 4/4] update doc assist documentation --- api-reference/assist/llm/chat.mdx | 2 +- api-reference/assist/prompt/chat_stream.mdx | 2 +- api-reference/assist/prompt/prompt_stream.mdx | 2 +- api-reference/assist/prompt/run_prompt.mdx | 2 +- api-reference/assist/references.yaml | 67 +++++++++---------- 5 files changed, 35 insertions(+), 40 deletions(-) diff --git a/api-reference/assist/llm/chat.mdx b/api-reference/assist/llm/chat.mdx index 53c7681d..0424048a 100644 --- a/api-reference/assist/llm/chat.mdx +++ b/api-reference/assist/llm/chat.mdx @@ -1,3 +1,3 @@ --- -openapi: post /llm_router/v1/chat +openapi: post /doc_assist/llm_router/v1/chat --- \ No newline at end of file diff --git a/api-reference/assist/prompt/chat_stream.mdx b/api-reference/assist/prompt/chat_stream.mdx index a9dc09e9..70153f87 100644 --- a/api-reference/assist/prompt/chat_stream.mdx +++ b/api-reference/assist/prompt/chat_stream.mdx @@ -1,3 +1,3 @@ --- -openapi: post /prompt_runner/v1/run_chat_stream +openapi: post /doc_assist/prompt_runner/v1/run_chat_stream --- \ No newline at end of file diff --git a/api-reference/assist/prompt/prompt_stream.mdx b/api-reference/assist/prompt/prompt_stream.mdx index a67116d3..5cb750d1 100644 --- a/api-reference/assist/prompt/prompt_stream.mdx +++ b/api-reference/assist/prompt/prompt_stream.mdx @@ -1,3 +1,3 @@ --- -openapi: post /prompt_runner/v1/run_prompt_stream +openapi: post /doc_assist/prompt_runner/v1/run_prompt_stream --- \ No newline at end of file diff --git a/api-reference/assist/prompt/run_prompt.mdx b/api-reference/assist/prompt/run_prompt.mdx index b53c16f5..cb1145fe 100644 --- a/api-reference/assist/prompt/run_prompt.mdx +++ b/api-reference/assist/prompt/run_prompt.mdx @@ -1,3 +1,3 @@ --- -openapi: post /prompt_runner/v1/run_prompt +openapi: post /doc_assist/prompt_runner/v1/run_prompt --- \ No newline at end of file diff --git a/api-reference/assist/references.yaml b/api-reference/assist/references.yaml index b77abc1e..243b49bf 100644 --- a/api-reference/assist/references.yaml +++ b/api-reference/assist/references.yaml @@ -4,19 +4,28 @@ info: description: Lucid - Prompt runner + LLM stream chat version: 0.0.1 servers: -- url: http://127.0.0.1:9999 - description: Local Development - url: https://api.dev.eka.care description: Staging Server - url: https://api.eka.care description: Production Server paths: - /prompt_runner/v1/run_prompt_stream: + /doc_assist/llm_router/v1/chat: post: - summary: Run Prompt Stream - description: Run a prompt with streaming response - operationId: run_prompt_stream_prompt_runner_v1_run_prompt_stream_post + summary: Stream Chat + operationId: stream_chat_doc_assist_llm_router_v1_chat_post parameters: + - name: session_id + in: query + required: true + schema: + type: string + title: Session Id + - name: model_id + in: query + required: false + schema: + default: anthropic.claude-3-5-sonnet-20241022-v2:0 + title: Model Id - name: Authorization in: header required: false @@ -25,12 +34,6 @@ paths: - type: string - type: 'null' title: Authorization - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RunPromptStreamRequest' responses: '200': description: Successful Response @@ -40,11 +43,11 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' - /prompt_runner/v1/run_chat_stream: + /doc_assist/prompt_runner/v1/run_prompt_stream: post: - summary: Run Chat Stream + summary: Run Prompt Stream description: Run a prompt with streaming response - operationId: run_chat_stream_prompt_runner_v1_run_chat_stream_post + operationId: run_prompt_stream_doc_assist_prompt_runner_v1_run_prompt_stream_post parameters: - name: Authorization in: header @@ -69,11 +72,11 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' - /prompt_runner/v1/run_prompt: + /doc_assist/prompt_runner/v1/run_chat_stream: post: - summary: Run Prompt + summary: Run Chat Stream description: Run a prompt with streaming response - operationId: run_prompt_prompt_runner_v1_run_prompt_post + operationId: run_chat_stream_doc_assist_prompt_runner_v1_run_chat_stream_post parameters: - name: Authorization in: header @@ -92,32 +95,18 @@ paths: responses: '200': description: Successful Response - content: - application/json: - schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' - /llm_router/v1/chat: + /doc_assist/prompt_runner/v1/run_prompt: post: - summary: Stream Chat - operationId: stream_chat_llm_router_v1_chat_post + summary: Run Prompt + description: Run a prompt with streaming response + operationId: run_prompt_doc_assist_prompt_runner_v1_run_prompt_post parameters: - - name: session_id - in: query - required: true - schema: - type: string - title: Session Id - - name: model_id - in: query - required: false - schema: - default: anthropic.claude-3-5-sonnet-20241022-v2:0 - title: Model Id - name: Authorization in: header required: false @@ -126,6 +115,12 @@ paths: - type: string - type: 'null' title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunPromptStreamRequest' responses: '200': description: Successful Response