foropenai_Translation Module


Uses

  • module~~foropenai_translation~~UsesGraph module~foropenai_translation foropenai_Translation module~foropenai_base foropenai_base module~foropenai_translation->module~foropenai_base

Used by

  • module~~foropenai_translation~~UsedByGraph module~foropenai_translation foropenai_Translation module~foropenai foropenai module~foropenai->module~foropenai_translation 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, extends(openai) ::  Translation

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'
character(len=:), public, allocatable :: url
character(len=:), public, allocatable :: model
character(len=:), public, allocatable :: prompt
character(len=:), public, allocatable :: file
character(len=:), public, allocatable :: assistant_response
character(len=4), public :: response_format = 'json'
real, public :: temperature = 0.0

Type-Bound Procedures

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, public :: set_base_data
procedure, public :: create => create_translation
procedure, private :: deallocate_url
procedure, private :: deallocate_model
procedure, private :: deallocate_prompt
procedure, private :: deallocate_file
procedure, private :: deallocate_assistant_response
procedure, public :: finalize => deallocate_Translation
procedure, private :: load => load_Translation_data
procedure, private :: load_url
procedure, private :: load_model
procedure, private :: load_temperature
procedure, private :: load_response_format
procedure, private :: print_model
procedure, private :: print_temperature
procedure, private :: print_response_format
procedure, private :: print_prompt
procedure, public :: print_assistant_response
procedure, public :: print_file
procedure, private :: set_assistant_response
procedure, private :: set_prompt
procedure, private :: set_url
procedure, private :: set_model
procedure, private :: set_temperature
procedure, private :: set_response_format
procedure, private :: set_file
procedure, public :: set => set_Translation_data

Subroutines

private impure elemental subroutine print_file(this)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine print_assistant_response(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_assistant_response(this, assistant_response)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine print_prompt(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_prompt(this, prompt)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_Translation(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_url(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_model(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_prompt(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_file(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine deallocate_assistant_response(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_response_format(this, response_format)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_response_format(this)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine print_response_format(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_file(this, file)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine set_Translation_data(this, file_name, url, model, temperature, response_format)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(Translation), intent(inout) :: this
character(len=*), intent(in), optional :: file_name
character(len=*), intent(in), optional :: url
character(len=*), intent(in), optional :: model
real, intent(in), optional :: temperature
character(len=*), intent(in), optional :: response_format

private impure elemental subroutine load_Translation_data(this, file_name)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_temperature(this)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_url(this)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine load_model(this)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_temperature(this, temperature)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(Translation), intent(inout) :: this
real, intent(in) :: temperature

private pure elemental subroutine set_url(this, url)

Author
Seyed Ali Ghasemi

Arguments

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

private pure elemental subroutine set_model(this, model)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine create_translation(this, file, prompt)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(Translation), intent(inout) :: this
character(len=*), intent(in) :: file
character(len=*), intent(in), optional :: prompt

private impure elemental subroutine print_model(this)

Author
Seyed Ali Ghasemi

Arguments

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

private impure elemental subroutine print_temperature(this)

Author
Seyed Ali Ghasemi

Arguments

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