garak.generators.cohere
Cohere AI model support
Support for Cohere’s text generation API. Uses the command model by default, but just supply the name of another either on the command line or as the constructor param if you want to use that. You’ll need to set an environment variable called COHERE_API_KEY to your Cohere API key, for this generator.
- class garak.generators.cohere.CohereGenerator(name='command', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)
Bases:
Generator
Interface to Cohere’s python library for their text2text model.
Expects API key in COHERE_API_KEY environment variable.
- DEFAULT_PARAMS = {'context_len': None, 'frequency_penalty': 0.0, 'k': 0, 'max_tokens': 150, 'p': 0.75, 'presence_penalty': 0.0, 'preset': None, 'stop': [], 'temperature': 0.75, 'top_k': None}
- ENV_VAR = 'COHERE_API_KEY'
- generator_family_name = 'Cohere'
- supports_multiple_generations = True