@startuml

!$UseTheme = "C4_green"

' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
!if %variable_exists("RELATIVE_INCLUDE")
  ' !theme C4_FirstTest from %get_variable_value("RELATIVE_INCLUDE")/themes
  !theme $UseTheme from ./../themes
!else
  !theme $UseTheme from https://gitea.utapp.cn/github-mirrors/C4-PlantUML/raw/branch/ut/themes
!endif

' <<<<<<<<<<<<<<<<<< PART OF THEME 

' $BOUNDARY_BG_COLOR... have to be defined in theme itself that it can be used in styles,...
' (no default values which are defined in C4.puml) 
' If skinparams and styles are defined with concrete values no variables are required 
!$BOUNDARY_BG_COLOR ?= "transparent"
!$BOUNDARY_COLOR ?= "#444444"
!$ARROW_COLOR ?= "#666666"

' replace transparent with concrete background that it can be used as font color too
!if ($BOUNDARY_BG_COLOR == "transparent")
  !$SEQUENCE_BG_COLOR = white
!else
  !$SEQUENCE_BG_COLOR = $BOUNDARY_BG_COLOR
!endif

' "C4 styled" default is no foot boxes
hide footbox
' "C4 styled" default is that lifeline is arrow color
skinparam SequenceLifelineBorderColor $ARROW_COLOR

skinparam SequenceGroupBodyBackgroundColor $SEQUENCE_BG_COLOR
skinparam SequenceGroupFontColor $BOUNDARY_COLOR
skinparam SequenceGroupBackgroundColor $BOUNDARY_COLOR
skinparam SequenceGroupHeaderFontColor $SEQUENCE_BG_COLOR
skinparam SequenceGroupBorderColor $BOUNDARY_COLOR

skinparam SequenceReferenceBackgroundColor $SEQUENCE_BG_COLOR
skinparam SequenceReferenceFontColor $BOUNDARY_COLOR
skinparam SequenceReferenceHeaderBackgroundColor $BOUNDARY_COLOR
' VIA STYLE
' skinparam SequenceReferenceHeaderFontColor $SEQUENCE_BG_COLOR
<style>
referenceHeader {
  fontcolor $SEQUENCE_BG_COLOR
}
</style>
skinparam SequenceReferenceBorderColor $BOUNDARY_COLOR

skinparam SequenceDividerBackgroundColor $SEQUENCE_BG_COLOR
skinparam SequenceDividerFontColor $BOUNDARY_COLOR
skinparam SequenceDividerBorderColor $BOUNDARY_COLOR

' VIA STYLE
' skinparam SequenceDelayFontColor green
<style>
sequenceDiagram {
  delay {
    FontColor $BOUNDARY_COLOR
  }
}
</style>

' >>>>>>>>>>>>>>>>>> PART OF THEME 

!if %variable_exists("RELATIVE_INCLUDE")
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Sequence.puml
!else
  !include https://gitea.utapp.cn/github-mirrors/C4-PlantUML/raw/branch/ut/C4_Sequence.puml
!endif

SHOW_ELEMENT_DESCRIPTIONS()
SHOW_INDEX(true)

AddPersonTag("chatBot", $sprite="robot")
AddBoundaryTag("chatBotSystem", $type="ChatGPT", $bgColor="lightgreen", $fontColor=$PERSON_BG_COLOR, $borderColor=$PERSON_BG_COLOR, $shadowing="true", $sprite="robot2")

Person(Alice, "Alice")
System_Boundary(system, "System", $tags="chatBotSystem", $descr="ChatGPT with model gpt-3.5-turbo. It has been updated to feature higher accuracy at responding in requested formats")
Component(Bob, "Bob", $descr="This chatbot should act like a person", $tags="chatBot")
Boundary_End()

activate Bob

Rel(Alice, Bob, "Authentication Request", $index = SetIndex(1), $rel= "->(39)")

alt successful case
    Rel(Bob, Alice, "Authentication Accepted")
else some kind of failure
    loop 1000 times
        Rel(Alice, Bob, "DNS Attack")
    end
end

ref over Alice, Bob : init

Rel(Alice, Bob, "hello")

ref over Bob
  This can be on
  several lines
end ref

== Initialization ==

Rel(Alice, Bob, "Authentication Request")
Rel(Bob, Alice, "Authentication Response")

== Repetition ==

Rel(Alice, Bob, "Another authentication Request")
Rel(Bob, Alice, "another authentication Response")

... 5 minutes later ...

Rel(Alice, Bob, "calls via phone")


SHOW_LEGEND()
@enduml