Skip to content

Commit

Permalink
Merge pull request #447 from WolframResearch/feature/multimodal-messages
Browse files Browse the repository at this point in the history
Add support for GPT-4-Vision and longer contexts
  • Loading branch information
rhennigan authored Nov 11, 2023
2 parents 1aed8c2 + c99111a commit 62d3211
Show file tree
Hide file tree
Showing 14 changed files with 1,305 additions and 309 deletions.
6 changes: 2 additions & 4 deletions Source/Chatbook/Actions.wl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ ChatbookAction[ "TabRight" , args___ ] := catchMine @ TabRight @ arg
ChatbookAction[ "ToggleFormatting" , args___ ] := catchMine @ ToggleFormatting @ args;
ChatbookAction[ "ToolManage" , args___ ] := catchMine @ ToolManage @ args;
ChatbookAction[ "WidgetSend" , args___ ] := catchMine @ WidgetSend @ args;
ChatbookAction[ name_String , args___ ] := catchMine @ throwFailure[ "NotImplemented", name, args ];
ChatbookAction[ args___ ] := catchMine @ throwInternalFailure @ ChatbookAction @ args;

(* ::**************************************************************************************************************:: *)
Expand Down Expand Up @@ -634,8 +633,9 @@ CopyChatObject // endDefinition;
(*constructChatObject*)
constructChatObject // beginDefinition;

(* cSpell: ignore bdprompt *)
constructChatObject[ messages_List ] :=
With[ { chat = chatObject @ standardizeMessageKeys @ messages },
With[ { chat = Quiet[ ChatObject @ standardizeMessageKeys @ messages, ChatObject::bdprompt ] },
chat /; MatchQ[ chat, _chatObject ]
];

Expand All @@ -644,8 +644,6 @@ constructChatObject[ messages_List ] :=

constructChatObject // endDefinition;

chatObject := chatObject = Symbol[ "System`ChatObject" ];

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*standardizeMessageKeys*)
Expand Down
Loading

0 comments on commit 62d3211

Please sign in to comment.