foropenai_base Module


Used by

  • module~~foropenai_base~~UsedByGraph module~foropenai_base foropenai_base module~foropenai foropenai module~foropenai->module~foropenai_base module~foropenai_chatcompletion foropenai_ChatCompletion module~foropenai->module~foropenai_chatcompletion module~foropenai_imagegeneration foropenai_ImageGeneration module~foropenai->module~foropenai_imagegeneration module~foropenai_transcription foropenai_Transcription module~foropenai->module~foropenai_transcription module~foropenai_translation foropenai_Translation module~foropenai->module~foropenai_translation module~foropenai_chatcompletion->module~foropenai_base module~foropenai_imagegeneration->module~foropenai_base module~foropenai_transcription->module~foropenai_base module~foropenai_translation->module~foropenai_base program~test_base test_base program~test_base->module~foropenai program~test_chatcompletion test_ChatCompletion program~test_chatcompletion->module~foropenai program~test_imagegeneration test_ImageGeneration program~test_imagegeneration->module~foropenai program~test_transcription test_Transcription program~test_transcription->module~foropenai program~test_translation test_Translation program~test_translation->module~foropenai

Derived Types

type, public ::  openai

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: organization
character(len=:), public, allocatable :: api_key
character(len=:), public, allocatable :: file_name
character(len=14), public :: api_key_env = 'OPENAI_API_KEY'
character(len=10), public :: organization_env = 'OPENAI_ORG'

Type-Bound Procedures

procedure, private :: deallocate_api_key
procedure, private :: deallocate_organization
procedure, private :: deallocate_file_name
procedure, public :: finalize => deallocate_openai
procedure, private :: load_api_key
procedure, private :: load_organization
procedure, public :: load_base_data
procedure, public :: print_api_key
procedure, public :: print_organization
procedure, public :: print_file_name
procedure, public :: set_file_name
procedure, private :: set_api_key
procedure, private :: set_organization
procedure, private :: set_api_key_env
procedure, private :: set_organization_env
procedure, public :: set_base_data

Subroutines

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

Author
Seyed Ali Ghasemi

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

private impure elemental subroutine set_api_key_env(this, status)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this
integer, intent(out), optional :: status

private impure elemental subroutine set_organization_env(this, status)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this
integer, intent(out), optional :: status

private pure elemental subroutine deallocate_openai(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private pure elemental subroutine deallocate_api_key(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private pure elemental subroutine deallocate_organization(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private pure elemental subroutine deallocate_file_name(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private impure elemental subroutine load_base_data(this, file_name)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_organization(this, organization)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_api_key(this, api_key)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_api_key(this, file_name)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_file_name(this, file_name)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_organization(this, file_name)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine print_api_key(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private impure elemental subroutine print_organization(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this

private impure elemental subroutine print_file_name(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(openai), intent(inout) :: this