-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Mintlify - new components #18519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Mintlify - new components #18519
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
components/mintlify/actions/chat-with-assistant/chat-with-assistant.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import mintlify from "../../mintlify.app.mjs"; | ||
import { v4 as uuidv4 } from "uuid"; | ||
|
||
export default { | ||
key: "mintlify-chat-with-assistant", | ||
name: "Chat with Assistant", | ||
description: "Generates a response message from the assistant for the specified domain. [See the documentation](https://www.mintlify.com/docs/api-reference/assistant/create-assistant-message)", | ||
version: "0.0.1", | ||
type: "action", | ||
annotations: { | ||
destructiveHint: false, | ||
openWorldHint: true, | ||
readOnlyHint: true, | ||
}, | ||
props: { | ||
mintlify, | ||
domain: { | ||
propDefinition: [ | ||
mintlify, | ||
"domain", | ||
], | ||
}, | ||
fp: { | ||
type: "string", | ||
label: "FP", | ||
description: "Browser fingerprint or arbitrary string identifier. There may be future functionality which allows you to get the messages for a given fingerprint", | ||
}, | ||
message: { | ||
type: "string", | ||
label: "Message", | ||
description: "The content of the message", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.mintlify.chatWithAssistant({ | ||
$, | ||
domain: this.domain, | ||
data: { | ||
fp: this.fp, | ||
messages: [ | ||
{ | ||
id: uuidv4(), | ||
role: "user", | ||
content: this.message, | ||
parts: [ | ||
{ | ||
type: "text", | ||
text: this.message, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Successfully sent message with ID ${response.id}`); | ||
return response; | ||
}, | ||
}; |
65 changes: 65 additions & 0 deletions
65
components/mintlify/actions/search-documentation/search-documentation.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import mintlify from "../../mintlify.app.mjs"; | ||
|
||
export default { | ||
key: "mintlify-search-documentation", | ||
name: "Search Documentation", | ||
description: "Perform semantic and keyword searches across your documentation. [See the documentation](https://www.mintlify.com/docs/api-reference/assistant/search)", | ||
version: "0.0.1", | ||
type: "action", | ||
annotations: { | ||
destructiveHint: false, | ||
openWorldHint: true, | ||
readOnlyHint: true, | ||
}, | ||
props: { | ||
mintlify, | ||
domain: { | ||
propDefinition: [ | ||
mintlify, | ||
"domain", | ||
], | ||
}, | ||
query: { | ||
type: "string", | ||
label: "Search Query", | ||
description: "The search query to execute against your documentation content", | ||
}, | ||
pageSize: { | ||
type: "integer", | ||
label: "Page Size", | ||
description: "Number of search results to return. Defaults to 10 if not specified", | ||
optional: true, | ||
}, | ||
version: { | ||
type: "string", | ||
label: "Version", | ||
description: "Filter results by documentation version", | ||
optional: true, | ||
}, | ||
language: { | ||
type: "string", | ||
label: "Language", | ||
description: "Filter results by content language", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.mintlify.searchDocumentation({ | ||
$, | ||
domain: this.domain, | ||
data: { | ||
query: this.query, | ||
pageSize: this.pageSize, | ||
filter: this.version || this.language | ||
? { | ||
version: this.version, | ||
language: this.language, | ||
} | ||
: undefined, | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Found ${response.length} results`); | ||
return response; | ||
}, | ||
}; |
26 changes: 26 additions & 0 deletions
26
components/mintlify/actions/trigger-update/trigger-update.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import mintlify from "../../mintlify.app.mjs"; | ||
|
||
export default { | ||
key: "mintlify-trigger-update", | ||
name: "Trigger Update", | ||
description: "Trigger an update for a project. [See the documentation](https://www.mintlify.com/docs/api-reference/update/trigger)", | ||
version: "0.0.1", | ||
type: "action", | ||
annotations: { | ||
destructiveHint: false, | ||
openWorldHint: true, | ||
readOnlyHint: false, | ||
}, | ||
props: { | ||
mintlify, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.mintlify.triggerUpdate({ | ||
$, | ||
}); | ||
|
||
$.export("$summary", `Successfully triggered an update for project ${this.mintlify.$auth.project_id}`); | ||
|
||
return response; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,57 @@ | ||
import { axios } from "@pipedream/platform"; | ||
|
||
export default { | ||
type: "app", | ||
app: "mintlify", | ||
propDefinitions: {}, | ||
propDefinitions: { | ||
domain: { | ||
type: "string", | ||
label: "Domain", | ||
description: "The domain identifier from your domain.mintlify.app URL. Can be found in the top left of your dashboard.", | ||
}, | ||
}, | ||
methods: { | ||
// this.$auth contains connected account data | ||
authKeys() { | ||
console.log(Object.keys(this.$auth)); | ||
_baseUrl() { | ||
return "https://api-dsc.mintlify.com/v1"; | ||
}, | ||
_makeRequest({ | ||
$ = this, path, ...opts | ||
}) { | ||
return axios($, { | ||
url: `${this._baseUrl()}${path}`, | ||
headers: { | ||
Authorization: `Bearer ${this.$auth.assistant_api_key}`, | ||
}, | ||
...opts, | ||
}); | ||
}, | ||
triggerUpdate(opts = {}) { | ||
return this._makeRequest({ | ||
url: `https://api.mintlify.com/v1/project/update/${this.$auth.project_id}`, | ||
method: "POST", | ||
headers: { | ||
Authorization: `Bearer ${this.$auth.admin_api_key}`, | ||
}, | ||
...opts, | ||
}); | ||
}, | ||
searchDocumentation({ | ||
domain, ...opts | ||
}) { | ||
return this._makeRequest({ | ||
path: `/search/${domain}`, | ||
method: "POST", | ||
...opts, | ||
}); | ||
}, | ||
chatWithAssistant({ | ||
domain, ...opts | ||
}) { | ||
return this._makeRequest({ | ||
path: `/assistant/${domain}/message`, | ||
method: "POST", | ||
...opts, | ||
}); | ||
}, | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.