@@ -861,52 +861,152 @@ private constructor(
861
861
862
862
interface Visitor <out T > {
863
863
864
+ /* *
865
+ * Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object)
866
+ * is created.
867
+ */
864
868
fun visitThreadCreated (threadCreated : ThreadCreated ): T
865
869
870
+ /* *
871
+ * Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is
872
+ * created.
873
+ */
866
874
fun visitThreadRunCreated (threadRunCreated : ThreadRunCreated ): T
867
875
876
+ /* *
877
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to
878
+ * a `queued` status.
879
+ */
868
880
fun visitThreadRunQueued (threadRunQueued : ThreadRunQueued ): T
869
881
882
+ /* *
883
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to
884
+ * an `in_progress` status.
885
+ */
870
886
fun visitThreadRunInProgress (threadRunInProgress : ThreadRunInProgress ): T
871
887
888
+ /* *
889
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to
890
+ * a `requires_action` status.
891
+ */
872
892
fun visitThreadRunRequiresAction (threadRunRequiresAction : ThreadRunRequiresAction ): T
873
893
894
+ /* *
895
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is
896
+ * completed.
897
+ */
874
898
fun visitThreadRunCompleted (threadRunCompleted : ThreadRunCompleted ): T
875
899
900
+ /* *
901
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with
902
+ * status `incomplete`.
903
+ */
876
904
fun visitThreadRunIncomplete (threadRunIncomplete : ThreadRunIncomplete ): T
877
905
906
+ /* *
907
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails.
908
+ */
878
909
fun visitThreadRunFailed (threadRunFailed : ThreadRunFailed ): T
879
910
911
+ /* *
912
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to
913
+ * a `cancelling` status.
914
+ */
880
915
fun visitThreadRunCancelling (threadRunCancelling : ThreadRunCancelling ): T
881
916
917
+ /* *
918
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is
919
+ * cancelled.
920
+ */
882
921
fun visitThreadRunCancelled (threadRunCancelled : ThreadRunCancelled ): T
883
922
923
+ /* *
924
+ * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires.
925
+ */
884
926
fun visitThreadRunExpired (threadRunExpired : ThreadRunExpired ): T
885
927
928
+ /* *
929
+ * Occurs when a
930
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is
931
+ * created.
932
+ */
886
933
fun visitThreadRunStepCreated (threadRunStepCreated : ThreadRunStepCreated ): T
887
934
935
+ /* *
936
+ * Occurs when a
937
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to
938
+ * an `in_progress` state.
939
+ */
888
940
fun visitThreadRunStepInProgress (threadRunStepInProgress : ThreadRunStepInProgress ): T
889
941
942
+ /* *
943
+ * Occurs when parts of a
944
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are
945
+ * being streamed.
946
+ */
890
947
fun visitThreadRunStepDelta (threadRunStepDelta : ThreadRunStepDelta ): T
891
948
949
+ /* *
950
+ * Occurs when a
951
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is
952
+ * completed.
953
+ */
892
954
fun visitThreadRunStepCompleted (threadRunStepCompleted : ThreadRunStepCompleted ): T
893
955
956
+ /* *
957
+ * Occurs when a
958
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails.
959
+ */
894
960
fun visitThreadRunStepFailed (threadRunStepFailed : ThreadRunStepFailed ): T
895
961
962
+ /* *
963
+ * Occurs when a
964
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is
965
+ * cancelled.
966
+ */
896
967
fun visitThreadRunStepCancelled (threadRunStepCancelled : ThreadRunStepCancelled ): T
897
968
969
+ /* *
970
+ * Occurs when a
971
+ * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires.
972
+ */
898
973
fun visitThreadRunStepExpired (threadRunStepExpired : ThreadRunStepExpired ): T
899
974
975
+ /* *
976
+ * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object)
977
+ * is created.
978
+ */
900
979
fun visitThreadMessageCreated (threadMessageCreated : ThreadMessageCreated ): T
901
980
981
+ /* *
982
+ * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object)
983
+ * moves to an `in_progress` state.
984
+ */
902
985
fun visitThreadMessageInProgress (threadMessageInProgress : ThreadMessageInProgress ): T
903
986
987
+ /* *
988
+ * Occurs when parts of a
989
+ * [Message](https://platform.openai.com/docs/api-reference/messages/object) are being
990
+ * streamed.
991
+ */
904
992
fun visitThreadMessageDelta (threadMessageDelta : ThreadMessageDelta ): T
905
993
994
+ /* *
995
+ * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object)
996
+ * is completed.
997
+ */
906
998
fun visitThreadMessageCompleted (threadMessageCompleted : ThreadMessageCompleted ): T
907
999
1000
+ /* *
1001
+ * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object)
1002
+ * ends before it is completed.
1003
+ */
908
1004
fun visitThreadMessageIncomplete (threadMessageIncomplete : ThreadMessageIncomplete ): T
909
1005
1006
+ /* *
1007
+ * Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors)
1008
+ * occurs. This can happen due to an internal server error or a timeout.
1009
+ */
910
1010
fun visitErrorEvent (errorEvent : ErrorEvent ): T
911
1011
912
1012
fun unknown (json : JsonValue ? ): T {
0 commit comments