🔎 feat: search api

This commit is contained in:
Florian Hönicke
2023-05-17 00:21:25 +02:00
parent 8017b7fa74
commit f7971757fe
18 changed files with 227 additions and 83 deletions

View File

@@ -92,9 +92,16 @@ def deploy(path):
Deployer().deploy(path)
@main.command()
@click.option('--key', required=True, help='Your OpenAI API key.')
def configure(key):
set_api_key(key)
@click.option('--openai-api-key', default=None, help='Your OpenAI API key.')
@click.option('--google-api-key', default=None, help='Your Google API key.')
@click.option('--google-cse-id', default=None, help='Your Google CSE ID.')
def configure(openai_api_key, google_api_key, google_cse_id):
if openai_api_key:
set_api_key('OPENAI_API_KEY', openai_api_key)
if google_api_key:
set_api_key('GOOGLE_API_KEY', google_api_key)
if google_cse_id:
set_api_key('GOOGLE_CSE_ID', google_cse_id)
if __name__ == '__main__':