forked from activepieces/activepieces
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'activepieces:main' into apitraffic/main
- Loading branch information
Showing
127 changed files
with
3,768 additions
and
1,425 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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.
This file contains 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
This file contains 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
This file contains 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
This file contains 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,4 +1,4 @@ | ||
{ | ||
"name": "@activepieces/piece-dropbox", | ||
"version": "0.5.1" | ||
} | ||
"version": "0.5.2" | ||
} |
This file contains 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
This file contains 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,33 @@ | ||
{ | ||
"extends": [ | ||
"../../../../.eslintrc.base.json" | ||
], | ||
"ignorePatterns": [ | ||
"!**/*" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.ts", | ||
"*.tsx", | ||
"*.js", | ||
"*.jsx" | ||
], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": [ | ||
"*.ts", | ||
"*.tsx" | ||
], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": [ | ||
"*.js", | ||
"*.jsx" | ||
], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains 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,7 @@ | ||
# pieces-groq | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build pieces-groq` to build the library. |
This file contains 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,4 @@ | ||
{ | ||
"name": "@activepieces/piece-groq", | ||
"version": "0.0.1" | ||
} |
This file contains 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,45 @@ | ||
{ | ||
"name": "pieces-groq", | ||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/pieces/community/groq/src", | ||
"projectType": "library", | ||
"release": { | ||
"version": { | ||
"generatorOptions": { | ||
"packageRoot": "dist/{projectRoot}", | ||
"currentVersionResolver": "git-tag" | ||
} | ||
} | ||
}, | ||
"tags": [], | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": [ | ||
"{options.outputPath}" | ||
], | ||
"options": { | ||
"outputPath": "dist/packages/pieces/community/groq", | ||
"tsConfig": "packages/pieces/community/groq/tsconfig.lib.json", | ||
"packageJson": "packages/pieces/community/groq/package.json", | ||
"main": "packages/pieces/community/groq/src/index.ts", | ||
"assets": [ | ||
"packages/pieces/community/groq/*.md" | ||
], | ||
"buildableProjectDepsInPackageJsonType": "dependencies", | ||
"updateBuildableProjectDepsInPackageJson": true | ||
} | ||
}, | ||
"nx-release-publish": { | ||
"options": { | ||
"packageRoot": "dist/{projectRoot}" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": [ | ||
"{options.outputFile}" | ||
] | ||
} | ||
} | ||
} |
This file contains 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,66 @@ | ||
import { | ||
AuthenticationType, | ||
HttpMethod, | ||
createCustomApiCallAction, | ||
httpClient, | ||
} from '@activepieces/pieces-common'; | ||
import { PieceAuth, createPiece } from '@activepieces/pieces-framework'; | ||
import { PieceCategory } from '@activepieces/shared'; | ||
import { askGroq } from './lib/actions/ask-groq'; | ||
import { transcribeAudio } from './lib/actions/transcribe-audio'; | ||
import { translateAudio } from './lib/actions/translate-audio'; | ||
|
||
const baseUrl = 'https://api.groq.com/openai/v1'; | ||
|
||
export const groqAuth = PieceAuth.SecretText({ | ||
description: 'Enter your Groq API Key', | ||
displayName: 'API Key', | ||
required: true, | ||
validate: async (auth) => { | ||
try { | ||
await httpClient.sendRequest<{ | ||
data: { id: string }[]; | ||
}>({ | ||
url: `${baseUrl}/models`, | ||
method: HttpMethod.GET, | ||
authentication: { | ||
type: AuthenticationType.BEARER_TOKEN, | ||
token: auth.auth as string, | ||
}, | ||
}); | ||
return { | ||
valid: true, | ||
}; | ||
} catch (e) { | ||
return { | ||
valid: false, | ||
error: 'Invalid API key', | ||
}; | ||
} | ||
}, | ||
}); | ||
|
||
export const groq = createPiece({ | ||
displayName: 'Groq', | ||
description: 'Use Groq\'s fast language models and audio processing capabilities.', | ||
minimumSupportedRelease: '0.9.0', | ||
logoUrl: 'https://cdn.activepieces.com/pieces/groq.png', | ||
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE], | ||
auth: groqAuth, | ||
actions: [ | ||
askGroq, | ||
transcribeAudio, | ||
translateAudio, | ||
createCustomApiCallAction({ | ||
auth: groqAuth, | ||
baseUrl: () => baseUrl, | ||
authMapping: async (auth) => { | ||
return { | ||
Authorization: `Bearer ${auth}`, | ||
}; | ||
}, | ||
}), | ||
], | ||
authors: ['abuaboud'], | ||
triggers: [], | ||
}); |
Oops, something went wrong.