AI Assistant

Ask a question to JSMon AI about a JavaScript file

post
/api/ask-jsmon

Ask a question about a specific JavaScript file analyzed and uploaded via JSMon. This uses Google Gemini AI to generate the answer and tracks conversations.

Authorizations
Query parameters
wkspIdstringRequired

Workspace ID the user belongs to.

Body
jsmonIdstringRequired

JSMon ID corresponding to the JS file stored in S3.

questionstringRequired

The question to ask about the JavaScript file.

typestring · enumRequired

Type of input. Only 'file' is currently supported.

Possible values:
conversationNamestringOptional

Optional name of the conversation.

startNewConversationbooleanOptional

Whether to start a new conversation thread.

Default: false
Responses
200

AI-generated response from Gemini

application/json
post
/api/ask-jsmon
POST /api/ask-jsmon?wkspId=text HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 105

{
  "jsmonId": "text",
  "question": "text",
  "type": "file",
  "conversationName": "text",
  "startNewConversation": false
}
{
  "response": "text"
}

Get random prompt suggestions

get
/api/v2/promptSuggestions

Returns 3 random prompt suggestions from the database

Authorizations
Responses
200

Successfully retrieved prompt suggestions

No content

get
/api/v2/promptSuggestions
GET /api/v2/promptSuggestions HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
200

Successfully retrieved prompt suggestions

No content

Generate prompt suggestions based on question and response

post
/api/v2/generatePromptSuggestions

Generates 3 relevant follow-up questions based on the original question and its answer

Authorizations
Body
questionstringRequired

The original question asked

geminiResponsestringRequired

The response from Gemini

Responses
200

Successfully generated prompt suggestions

application/json
post
/api/v2/generatePromptSuggestions
POST /api/v2/generatePromptSuggestions HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "question": "text",
  "geminiResponse": "text"
}
{
  "message": "text",
  "suggestions": [
    "text"
  ]
}