-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New Components - openperplex #13856
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
New Components - openperplex #13856
Changes from all commits
Commits
Show all changes
2 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
27 changes: 27 additions & 0 deletions
27
components/openperplex/actions/get-website-screenshot/get-website-screenshot.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,27 @@ | ||
| import openperplex from "../../openperplex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "openperplex-get-website-screenshot", | ||
| name: "Get Website Screenshot", | ||
| description: "Get a screenshot of a website using Openperplex. [See the documentation](https://docs.openperplex.com/api-reference/endpoint/get-website-screenshot)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| openperplex, | ||
| url: { | ||
| type: "string", | ||
| label: "URL", | ||
| description: "The URL to create a screenshot of", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.openperplex.getWebsiteScreenshot({ | ||
| $, | ||
| params: { | ||
| url: this.url, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully created screenshot"); | ||
| return response; | ||
| }, | ||
| }; | ||
48 changes: 48 additions & 0 deletions
48
components/openperplex/actions/query-from-url/query-from-url.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,48 @@ | ||
| import openperplex from "../../openperplex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "openperplex-query-from-url", | ||
| name: "Query From URL", | ||
| description: "Queries content from a specific URL using Openperplex. [See the documentation](https://docs.openperplex.com/api-reference/endpoint/query-from-url)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| openperplex, | ||
| url: { | ||
| type: "string", | ||
| label: "URL", | ||
| description: "The URL to search", | ||
| }, | ||
| query: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "query", | ||
| ], | ||
| }, | ||
| responseLanguage: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "responseLanguage", | ||
| ], | ||
| }, | ||
| answerType: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "answerType", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.openperplex.queryFromUrl({ | ||
| $, | ||
| params: { | ||
| url: this.url, | ||
| query: this.query, | ||
| response_language: this.responseLanguage, | ||
| answer_type: this.answerType, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully performed search"); | ||
| return response; | ||
| }, | ||
| }; |
56 changes: 56 additions & 0 deletions
56
components/openperplex/actions/simple-search/simple-search.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,56 @@ | ||
| import openperplex from "../../openperplex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "openperplex-simple-search", | ||
| name: "Simple Search", | ||
| description: "Perform a simple search using Openperplex. [See the documentation](https://docs.openperplex.com/api-reference/endpoint/search-simple)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| openperplex, | ||
| query: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "query", | ||
| ], | ||
| }, | ||
| dateContext: { | ||
| type: "string", | ||
| label: "Date Context", | ||
| description: "A date for context. Format: `YYYY-MM-DD` or `YYYY-MM-DD HH:MM AM/PM`. If not provided, the API uses the current date.", | ||
| optional: true, | ||
| }, | ||
| location: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "location", | ||
| ], | ||
| }, | ||
| responseLanguage: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "responseLanguage", | ||
| ], | ||
| }, | ||
| answerType: { | ||
| propDefinition: [ | ||
| openperplex, | ||
| "answerType", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.openperplex.simpleSearch({ | ||
| $, | ||
| params: { | ||
| query: this.query, | ||
| date_context: this.dateContext, | ||
| location: this.location, | ||
| response_language: this.responseLanguage, | ||
| answer_type: this.answerType, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully performed search"); | ||
| 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 |
|---|---|---|
| @@ -0,0 +1,241 @@ | ||
| const ANSWER_TYPES = [ | ||
| "text", | ||
| "markdown", | ||
| "html", | ||
| ]; | ||
|
|
||
| const COUNTRIES = [ | ||
| { | ||
| label: "United States", | ||
| value: "us", | ||
| }, | ||
| { | ||
| label: "Canada", | ||
| value: "ca", | ||
| }, | ||
| { | ||
| label: "United Kingdom", | ||
| value: "uk", | ||
| }, | ||
| { | ||
| label: "Mexico", | ||
| value: "mx", | ||
| }, | ||
| { | ||
| label: "Spain", | ||
| value: "es", | ||
| }, | ||
| { | ||
| label: "Germany", | ||
| value: "de", | ||
| }, | ||
| { | ||
| label: "France", | ||
| value: "fr", | ||
| }, | ||
| { | ||
| label: "Belgium", | ||
| value: "be", | ||
| }, | ||
| { | ||
| label: "Portugal", | ||
| value: "pt", | ||
| }, | ||
| { | ||
| label: "Netherlands", | ||
| value: "nl", | ||
| }, | ||
| { | ||
| label: "Turkey", | ||
| value: "tr", | ||
| }, | ||
| { | ||
| label: "Italy", | ||
| value: "it", | ||
| }, | ||
| { | ||
| label: "Poland", | ||
| value: "pl", | ||
| }, | ||
| { | ||
| label: "Russia", | ||
| value: "ru", | ||
| }, | ||
| { | ||
| label: "South Africa", | ||
| value: "za", | ||
| }, | ||
| { | ||
| label: "United Arab Emirates", | ||
| value: "ae", | ||
| }, | ||
| { | ||
| label: "Saudi Arabia", | ||
| value: "sa", | ||
| }, | ||
| { | ||
| label: "Argentina", | ||
| value: "ar", | ||
| }, | ||
| { | ||
| label: "Brazil", | ||
| value: "br", | ||
| }, | ||
| { | ||
| label: "Australia", | ||
| value: "au", | ||
| }, | ||
| { | ||
| label: "China", | ||
| value: "cn", | ||
| }, | ||
| { | ||
| label: "Korea", | ||
| value: "kr", | ||
| }, | ||
| { | ||
| label: "Japan", | ||
| value: "jp", | ||
| }, | ||
| { | ||
| label: "India", | ||
| value: "in", | ||
| }, | ||
| { | ||
| label: "Palestine", | ||
| value: "ps", | ||
| }, | ||
| { | ||
| label: "Kuwait", | ||
| value: "kw", | ||
| }, | ||
| { | ||
| label: "Oman", | ||
| value: "om", | ||
| }, | ||
| { | ||
| label: "Qatar", | ||
| value: "qa", | ||
| }, | ||
| { | ||
| label: "Israel", | ||
| value: "il", | ||
| }, | ||
| { | ||
| label: "Morocco", | ||
| value: "ma", | ||
| }, | ||
| { | ||
| label: "Egypt", | ||
| value: "eg", | ||
| }, | ||
| { | ||
| label: "Iran", | ||
| value: "ir", | ||
| }, | ||
| { | ||
| label: "Libya", | ||
| value: "ly", | ||
| }, | ||
| { | ||
| label: "Yemen", | ||
| value: "ye", | ||
| }, | ||
| { | ||
| label: "Indonesia", | ||
| value: "id", | ||
| }, | ||
| { | ||
| label: "Pakistan", | ||
| value: "pk", | ||
| }, | ||
| { | ||
| label: "Bangladesh", | ||
| value: "bd", | ||
| }, | ||
| { | ||
| label: "Malaysia", | ||
| value: "my", | ||
| }, | ||
| { | ||
| label: "Philippines", | ||
| value: "ph", | ||
| }, | ||
| { | ||
| label: "Thailand", | ||
| value: "th", | ||
| }, | ||
| { | ||
| label: "Vietnam", | ||
| value: "vn", | ||
| }, | ||
| ]; | ||
|
|
||
| const LANGUAGES = [ | ||
| { | ||
| label: "English", | ||
| value: "en", | ||
| }, | ||
| { | ||
| label: "French", | ||
| value: "fr", | ||
| }, | ||
| { | ||
| label: "Spanish", | ||
| value: "es", | ||
| }, | ||
| { | ||
| label: "German", | ||
| value: "de", | ||
| }, | ||
| { | ||
| label: "Italian", | ||
| value: "it", | ||
| }, | ||
| { | ||
| label: "Portuguese", | ||
| value: "pt", | ||
| }, | ||
| { | ||
| label: "Dutch", | ||
| value: "nl", | ||
| }, | ||
| { | ||
| label: "Japanese", | ||
| value: "ja", | ||
| }, | ||
| { | ||
| label: "Korean", | ||
| value: "ko", | ||
| }, | ||
| { | ||
| label: "Chinese", | ||
| value: "zh", | ||
| }, | ||
| { | ||
| label: "Arabic", | ||
| value: "ar", | ||
| }, | ||
| { | ||
| label: "Russian", | ||
| value: "ru", | ||
| }, | ||
| { | ||
| label: "Turkish", | ||
| value: "tr", | ||
| }, | ||
| { | ||
| label: "Hindi", | ||
| value: "hi", | ||
| }, | ||
| { | ||
| label: "Auto-detect", | ||
| value: "auto", | ||
| }, | ||
| ]; | ||
|
|
||
| export default { | ||
| ANSWER_TYPES, | ||
| COUNTRIES, | ||
| LANGUAGES, | ||
| }; |
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.