File size: 434 Bytes
187a491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Funzione Modal temporanea per leggere il valore di boccaccio-api-key.
Uso: modal run scripts/get_api_key.py
"""
import os

import modal

app = modal.App("get-api-key")


@app.function(secrets=[modal.Secret.from_name("boccaccio-api-key")])
def get_key() -> str:
    return os.environ.get("BOCCACCIO_API_KEY", "<NON TROVATA>")


@app.local_entrypoint()
def main():
    print("API_KEY_START>>>" + get_key.remote() + "<<<API_KEY_END")