Added BraveSearch Api Tool
This commit is contained in:
parent
ab0534169c
commit
647bb1f864
|
|
@ -0,0 +1,38 @@
|
|||
import { INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { BraveSearch } from 'langchain/tools'
|
||||
|
||||
class BraveSearchAPI_Tools implements INode {
|
||||
label: string
|
||||
name: string
|
||||
description: string
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
baseClasses: string[]
|
||||
inputs: INodeParams[]
|
||||
|
||||
constructor() {
|
||||
this.label = 'BraveSearch API'
|
||||
this.name = 'braveSearchAPI'
|
||||
this.type = 'BraveSearchAPI'
|
||||
this.icon = 'brave-logo.svg'
|
||||
this.category = 'Tools'
|
||||
this.description = 'Wrapper around BraveSearch API - a real-time API to access Brave search results'
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'BraveSearch API Key',
|
||||
name: 'apiKey',
|
||||
type: 'password'
|
||||
}
|
||||
]
|
||||
this.baseClasses = [this.type, ...getBaseClasses(BraveSearch)]
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const apiKey = nodeData.inputs?.apiKey as string
|
||||
return new BraveSearch({apiKey})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: BraveSearchAPI_Tools }
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="188px" height="59px" viewBox="0 0 188 59" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 59.1 (86144) - https://sketch.com -->
|
||||
<title>Logotypes/bat/logo-dark@1x</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<linearGradient x1="0%" y1="50.7055163%" x2="100%" y2="50.7055163%" id="linearGradient-1">
|
||||
<stop stop-color="#FF5500" offset="0%"></stop>
|
||||
<stop stop-color="#FF5500" offset="40.9877232%"></stop>
|
||||
<stop stop-color="#FF2000" offset="58.1981215%"></stop>
|
||||
<stop stop-color="#FF2000" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="2.1484375%" y1="50.7055163%" x2="100%" y2="50.7055163%" id="linearGradient-2">
|
||||
<stop stop-color="#FF452A" offset="0%"></stop>
|
||||
<stop stop-color="#FF2000" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<path d="M38.1842742,5.7813753 L33.1825034,2.48580047e-05 L24.398906,2.48580047e-05 L15.6153086,2.48580047e-05 L10.6135379,5.7813753 C10.6135379,5.7813753 6.22173922,4.53847507 4.14783428,6.65140547 C4.14783428,6.65140547 10.0035659,6.11285679 12.0164736,9.44793099 C12.0164736,9.44793099 17.4452248,10.5043962 18.1771912,10.5043962 C18.9091577,10.5043962 20.495085,9.88294608 21.9590179,9.38578598 C23.4229508,8.88862589 24.398906,8.88502148 24.398906,8.88502148 C24.398906,8.88502148 25.3748613,8.88862589 26.8387942,9.38578598 C28.3027271,9.88294608 29.8886544,10.5043962 30.6206209,10.5043962 C31.3525873,10.5043962 36.7813385,9.44793099 36.7813385,9.44793099 C38.7942462,6.11285679 44.6499778,6.65140547 44.6499778,6.65140547 C42.5760729,4.53847507 38.1842742,5.7813753 38.1842742,5.7813753" id="path-3"></path>
|
||||
</defs>
|
||||
<g id="Branding" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="logo_brave" transform="translate(-46.000000, -42.000000)">
|
||||
<g id="Logo/Logotypes/brave/logo-dark" transform="translate(46.000000, 42.000000)">
|
||||
<g id="Logotypes/brave/logo-dark" transform="translate(-3.910345, 0.000000)">
|
||||
<g id="Group-5">
|
||||
<g id="Group-4" transform="translate(66.475862, 11.494737)" fill="#3B3E4F">
|
||||
<path d="M0.0945649427,20.129113 L0.0945649427,0.0903119492 L1.980335,0.0903119492 C3.51668973,0.0903119492 4.76215132,1.35635643 4.76215132,2.91810143 L4.76215132,11.8279155 C7.78427094,9.08707118 10.3542945,7.98990542 13.7796349,7.9195212 C20.3492831,7.78289301 26.0513956,12.7429103 26.5930963,19.4004293 C27.2406934,27.353846 21.5507997,33.3406448 14.1380534,33.3406448 C6.00032431,33.3406448 0.0945649427,28.2108774 0.0945649427,20.129113 Z M4.6847655,21.7024073 C5.14500744,25.8426554 9.03466275,29.2625004 13.1361108,29.3287444 C18.4798048,29.4115493 22.1210109,25.8716372 22.1210109,20.6342233 C22.1210109,15.3968094 18.5612636,11.939674 13.3682682,11.939674 C7.81685444,11.9272814 4.05346019,16.0261271 4.6847655,21.7024073 L4.6847655,21.7024073 Z" id="Shape"></path>
|
||||
<path d="M34.3805528,8.42049123 L34.3805528,11.9893851 C37.3171407,8.67718661 39.056285,7.78703326 42.4938443,7.78703326 C43.4937855,7.78812886 44.4920674,7.86980964 45.4793075,8.0313079 L45.4793075,12.771892 C44.4258391,12.4775227 43.3379356,12.329886 42.2453951,12.3330257 C39.7568303,12.3330257 37.6674134,13.1610754 36.1359889,14.7260892 C34.7919195,16.0965113 34.3927716,17.1688356 34.3927716,19.3217646 L34.3927716,32.5208757 L29.5541219,32.5208757 L29.5541219,8.42049123 L34.3805528,8.42049123 Z" id="Shape"></path>
|
||||
<path d="M46.6278759,16.3904689 C46.876325,14.0429482 47.3243482,12.771892 48.3181449,11.5505188 C50.3098114,9.06636994 53.8939964,7.78703326 58.9688765,7.78703326 C63.0010846,7.78703326 65.9376725,8.42463147 67.9782142,9.79091336 C69.6725562,10.9129206 70.3690285,12.5773004 70.3690285,15.5085961 L70.3690285,26.2111375 C70.3690285,28.5586582 70.9677503,29.3867079 72.6091442,29.3411651 C72.975838,29.328014 73.3415719,29.2948442 73.7047643,29.2417992 L73.7047643,32.4670525 C72.8887802,32.75052 72.0292596,32.8823502 71.1673243,32.8562358 C68.1329858,32.8562358 66.7400412,31.9288202 65.7951197,29.2376589 C62.8096565,32.0240459 59.7223699,33.1957361 55.2950869,33.1957361 C49.3730357,33.1957361 45.7399755,30.4590321 45.7399755,26.0082654 C45.7140288,23.4702229 47.1828382,21.1621376 49.4707862,20.145674 C51.2628787,19.3631671 52.3584989,19.1188924 57.4822543,18.5806602 C61.8606621,18.1417939 62.6100826,18.0424279 63.8523285,17.6491043 C65.1963979,17.210238 65.7951197,16.4774141 65.7951197,15.2560409 C65.7951197,12.6642456 63.6568275,11.4925554 59.1765963,11.4925554 C54.9407413,11.4925554 52.7576468,12.3454465 51.8819652,14.523217 C51.4482406,15.6368477 50.3924291,16.3709249 49.2141912,16.3780482 L46.6278759,16.3904689 Z M65.7706821,20.4975951 C62.7009314,21.4052066 59.5487148,21.9947443 56.3621965,22.2572005 C52.0326639,22.6960668 50.6885945,23.5282567 50.6885945,25.7267285 C50.6885945,28.1694749 52.680261,29.4529518 56.6106457,29.4529518 C59.844558,29.4529518 62.2842476,28.6249022 64.0274648,27.0102054 C65.4204095,25.6894663 65.7706821,24.7620507 65.7706821,22.4559325 L65.7706821,20.4975951 Z" id="Shape"></path>
|
||||
<path d="M85.3859491,32.5167935 L84.1396302,32.5167935 C83.0416911,32.5237809 82.0373317,31.8893056 81.5573878,30.8854777 L71.118449,8.42049123 L74.0183805,8.42049123 C75.7082351,8.40677493 77.2466325,9.40872492 77.9406193,10.9750243 L84.9053425,27.1219921 L92.102223,10.9129206 C92.8064623,9.37129713 94.3320539,8.39030838 96.0040971,8.40379017 L98.6392877,8.40379017 L87.9559726,30.9103192 C87.4710296,31.9004318 86.4739887,32.5236411 85.3859491,32.5167935 L85.3859491,32.5167935 Z" id="Shape"></path>
|
||||
<path d="M101.909857,21.863877 C102.406755,26.5092354 105.982794,29.3908481 111.314269,29.3908481 C114.340462,29.3908481 116.609088,28.4758533 118.014251,26.6500038 C118.833823,25.6029814 120.078508,24.9932201 121.39479,24.9939046 L124.201043,24.9939046 C121.757281,30.4673126 117.382946,33.1584739 110.862173,33.1584739 C102.716298,33.1584739 97.2259784,28.1239322 97.2259784,20.596961 C97.2259784,13.0699899 102.850705,7.79117351 110.963997,7.79117351 C116.8331,7.79117351 121.553634,10.4781946 123.455696,14.9786443 C124.302867,17.0487684 124.649067,18.8870385 124.649067,21.8680172 L101.909857,21.863877 Z M119.724885,18.1376536 C118.629265,13.8856188 115.395353,11.4884151 110.915121,11.4884151 C106.43489,11.4884151 103.200978,13.8856188 102.056482,18.1376536 L119.724885,18.1376536 Z" id="Shape"></path>
|
||||
</g>
|
||||
<g id="Build-Icons/Release">
|
||||
<g id="Logo" transform="translate(4.510718, 0.000000)">
|
||||
<path d="M47.089866,13.9845169 L48.4318045,10.6286862 C48.4318045,10.6286862 46.7238827,8.76433587 44.6499778,6.65140547 C42.5760729,4.53847507 38.1842742,5.7813753 38.1842742,5.7813753 L33.1825034,2.48580047e-05 L24.398906,2.48580047e-05 L15.6153086,2.48580047e-05 L10.6135379,5.7813753 C10.6135379,5.7813753 6.22173922,4.53847507 4.14783428,6.65140547 C2.07392934,8.76433587 0.366007623,10.6286862 0.366007623,10.6286862 L1.70794611,13.9845169 L2.43988816e-05,18.9561178 C2.43988816e-05,18.9561178 5.02314416,38.3397684 5.61176718,40.7068719 C6.77071405,45.3677478 7.56367771,47.1699531 10.8575267,49.5314636 C14.1513758,51.892974 20.1291018,55.9945448 21.105057,56.6159949 C22.0810123,57.237445 23.3009564,58.2960232 24.398906,58.2960232 C25.4968557,58.2960232 26.7167998,57.237445 27.6927551,56.6159949 C28.6687103,55.9945448 34.6464363,51.892974 37.9402853,49.5314636 C41.2341344,47.1699531 42.027098,45.3677478 43.1860449,40.7068719 C43.7745459,38.3397684 48.7977877,18.9561178 48.7977877,18.9561178 L47.089866,13.9845169 Z" id="Head" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M24.3988816,36.2785924 C24.7332683,36.2785924 26.8757341,37.0491905 28.5950013,37.9555134 C30.3141465,38.8619605 31.5600754,39.5029242 31.9583871,39.7568487 C32.3565769,40.0108975 32.113686,40.489787 31.7509966,40.7510446 C31.3881853,41.0123022 26.5131667,44.8583327 26.0400724,45.2834046 C25.5668561,45.7086007 24.87161,46.4107151 24.3988816,46.4107151 C23.9261533,46.4107151 23.2307852,45.7086007 22.7576909,45.2834046 C22.2844746,44.8583327 17.409578,41.0123022 17.0467666,40.7510446 C16.6839553,40.489787 16.4411864,40.0108975 16.8393761,39.7568487 C17.2376879,39.5029242 18.4836168,38.8619605 20.202884,37.9555134 C21.9219072,37.0491905 24.064495,36.2785924 24.3988816,36.2785924 Z M24.4250411,8.8855428 C24.5892284,8.89018473 25.5142835,8.93597447 26.8387942,9.38578598 C28.3027271,9.88294608 29.8886544,10.5043962 30.6206209,10.5043962 C31.3525873,10.5043962 36.7813385,9.44793099 36.7813385,9.44793099 C36.7813385,9.44793099 43.2148356,17.37142 43.2148356,19.0648716 C43.2148356,20.7583231 42.4055247,21.2052701 41.591822,22.0856163 C40.7781193,22.9659625 37.2243002,26.8107501 36.7679191,27.3044301 C36.311538,27.7982344 35.3614456,28.5468332 35.9203019,29.8942613 C36.4791583,31.2416895 37.3035965,32.9562703 36.3868086,34.6953363 C35.4698986,36.4344023 33.8992206,37.5951469 32.8927667,37.4032431 C31.8863128,37.211215 29.5226712,35.9527785 28.653461,35.3779371 C27.7842509,34.8030958 25.0293731,32.4883184 25.0293731,31.6026277 C25.0293731,30.7170613 27.8770886,29.1268947 28.4031285,28.7655836 C28.9294124,28.4043968 31.3290424,27.0060097 31.3782061,26.457145 C31.4272479,25.908156 31.4085827,25.7472004 30.7004052,24.3909477 C29.9922277,23.0345706 28.7168981,21.2246593 28.9291684,20.0204133 C29.1414387,18.8162915 31.1982644,18.1901184 32.6661011,17.6253445 C34.1336938,17.0606949 36.9596943,15.9941622 37.3126241,15.8283594 C37.6657979,15.6624322 37.5745461,15.5044596 36.5050211,15.4011745 C35.4357401,15.2978895 32.4010073,14.8874839 31.03284,15.2760145 C29.6646727,15.6645451 27.3272598,16.2556685 27.1379245,16.5691279 C26.9485892,16.8825873 26.7815788,16.893152 26.9760379,17.9744752 C27.170375,19.0557984 28.1714611,24.2444097 28.2685687,25.1660202 C28.3657982,26.0876308 28.5558655,26.6969005 27.5805202,26.9241026 C26.6050529,27.1513048 24.9631302,27.5458013 24.398906,27.5458013 C23.8346819,27.5458013 22.1926372,27.1513048 21.2172919,26.9241026 C20.2418246,26.6969005 20.4318919,26.0876308 20.5291214,25.1660202 C20.626351,24.2444097 21.6273151,19.0557984 21.8217742,17.9744752 C22.0161113,16.893152 21.8491009,16.8825873 21.6598876,16.5691279 C21.4705523,16.2556685 19.1330174,15.6645451 17.7648501,15.2760145 C16.3966828,14.8874839 13.3620719,15.2978895 12.2926689,15.4011745 C11.223266,15.5044596 11.1320141,15.6624322 11.485066,15.8283594 C11.8381178,15.9941622 14.6641182,17.0606949 16.131711,17.6253445 C17.5994257,18.1901184 19.6563734,18.8162915 19.8686437,20.0204133 C20.080914,21.2246593 18.8054624,23.0345706 18.0974069,24.3909477 C17.3892293,25.7472004 17.3704422,25.908156 17.4196059,26.457145 C17.4686477,27.0060097 19.8683997,28.4043968 20.3945616,28.7655836 C20.9207235,29.1268947 23.7683169,30.7170613 23.7683169,31.6026277 C23.7683169,32.4883184 21.0135612,34.8030958 20.1443511,35.3779371 C19.2751409,35.9527785 16.9114992,37.211215 15.9050454,37.4032431 C14.8985915,37.5951469 13.3279135,36.4344023 12.4110035,34.6953363 C11.4942155,32.9562703 12.3186538,31.2416895 12.8773881,29.8942613 C13.4362445,28.5468332 12.4862741,27.7982344 12.029771,27.3044301 C11.5735119,26.8107501 8.01957081,22.9659625 7.20586811,22.0856163 C6.39216541,21.2052701 5.5829765,20.7583231 5.5829765,19.0648716 C5.5829765,17.37142 12.0164736,9.44793099 12.0164736,9.44793099 C12.0164736,9.44793099 17.4452248,10.5043962 18.1771912,10.5043962 C18.9091577,10.5043962 20.495085,9.88294608 21.9590179,9.38578598 C23.2835286,8.93597447 24.2085837,8.89018473 24.372771,8.8855428 Z" id="Face" fill="#FFFFFF"></path>
|
||||
<mask id="mask-4" fill="white">
|
||||
<use xlink:href="#path-3"></use>
|
||||
</mask>
|
||||
<use id="Top-Head" fill="url(#linearGradient-2)" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue