set_base_data Subroutine

private impure elemental subroutine set_base_data(this, file_name, api_key, organization)

Type Bound

openai

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this
character(len=*), intent(in), optional :: file_name
character(len=*), intent(in), optional :: api_key
character(len=*), intent(in), optional :: organization

Calls

proc~~set_base_data~~CallsGraph proc~set_base_data foropenai_base::openai%set_base_data proc~load_api_key foropenai_base::openai%load_api_key proc~set_base_data->proc~load_api_key proc~load_organization foropenai_base::openai%load_organization proc~set_base_data->proc~load_organization proc~set_api_key foropenai_base::openai%set_api_key proc~set_base_data->proc~set_api_key proc~set_api_key_env foropenai_base::openai%set_api_key_env proc~set_base_data->proc~set_api_key_env proc~set_file_name foropenai_base::openai%set_file_name proc~set_base_data->proc~set_file_name proc~set_organization foropenai_base::openai%set_organization proc~set_base_data->proc~set_organization proc~set_organization_env foropenai_base::openai%set_organization_env proc~set_base_data->proc~set_organization_env proc~load_api_key->proc~set_file_name destroy destroy proc~load_api_key->destroy get get proc~load_api_key->get initialize initialize proc~load_api_key->initialize load_file load_file proc~load_api_key->load_file proc~load_organization->proc~set_file_name proc~load_organization->destroy proc~load_organization->get proc~load_organization->initialize proc~load_organization->load_file proc~set_api_key_env->proc~set_api_key proc~set_organization_env->proc~set_organization

Called by

proc~~set_base_data~~CalledByGraph proc~set_base_data foropenai_base::openai%set_base_data proc~conversation foropenai_ChatCompletion::ChatCompletion%conversation proc~conversation->proc~set_base_data program~test_base test_base program~test_base->proc~set_base_data program~test_chatcompletion test_ChatCompletion program~test_chatcompletion->proc~set_base_data program~test_imagegeneration test_ImageGeneration program~test_imagegeneration->proc~set_base_data program~test_transcription test_Transcription program~test_transcription->proc~set_base_data program~test_translation test_Translation program~test_translation->proc~set_base_data

Source Code

   elemental impure subroutine set_base_data(this, file_name, api_key, organization)
      class(openai),              intent(inout) :: this
      character(len=*), optional, intent(in)    :: file_name
      character(len=*), optional, intent(in)    :: api_key
      character(len=*), optional, intent(in)    :: organization
      integer                                   :: stat_api_key, stat_organization

      if (present(api_key)) call this%set_api_key(api_key)
      if (present(organization)) call this%set_organization(organization)

      if (present(file_name)) call this%set_file_name(file_name)

      call this%set_api_key_env(status=stat_api_key)
      if (stat_api_key == 1) call this%load_api_key(file_name)
      
      call this%set_organization_env(status=stat_organization)
      if (stat_organization == 1) call this%load_organization(file_name)
   end subroutine set_base_data