cf() - Custom Configuration

  • Request Configuration – Generates a custom configuration dictionary containing your API key and model key to override defaults when passed to gn() or ex().
Signature
ranno.cf(api_key: str, model: str) -> dict
ParameterTypeRequiredDescription
api_keystrYesProvider API key.
modelstrYesTarget model key.
ReturnsDescription
dictA dictionary with configuration keys.
cf() - API
from ranno import gn, ex, xp, cf

# Configure custom credentials and model
my_config = cf(api_key="api_key", model="model_name")

# Run generation with custom config
print(gn("Plot a sine wave", config=my_config))

# Run execution with custom config
ex("Plot correlation heatmap", data="data.csv", config=my_config)

# Run explanation with custom config
print(xp("Explain decorators", config=my_config))