ConnectorTypeOPENAI
class connector_types.connector_type_openai.ConnectorTypeOPENAI
Access OpenAI APIs
Input Schema
-
authentication
The authentication method.
Type:
anyOf
Options: -
action
The action to perform.
Type:
anyOf
Options:
Output Schema
-
result
Data
Constants
ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca']Example
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
response = this.connect(
connector_type='OPENAI',
authentication={
'authentication_method': 'openai',
'api_key': '*your secret openai api key*',
},
action={
'action_name': 'create_completion',
'model': 'text-davinci-003',
'prompt': 'Hello world!',
},
).get('output_value')['response']
return this.success(response)