4
4
% Copyright 2024 The MathWorks, Inc.
5
5
6
6
methods (TestClassSetup )
7
- function saveEnvVar (testCase )
7
+ function setUpAndTearDowns (testCase )
8
8
openAIEnvVar = " OPENAI_KEY" ;
9
9
key = getenv(openAIEnvVar );
10
10
writelines(" OPENAI_API_KEY=" +key ," .env" );
11
-
11
+
12
12
testCase .addTeardown(@() delete(" .env" ));
13
13
testCase .addTeardown(@() unsetenv(" OPENAI_API_KEY" ));
14
+ testCase .addTeardown(@() iCloseAll());
14
15
end
15
16
end
16
17
17
18
methods (Test )
18
19
function testAnalyzeScientificPapersUsingFunctionCalls(~)
19
20
AnalyzeScientificPapersUsingFunctionCalls ;
20
21
end
22
+
23
+ function testProcessGeneratedTextinRealTimebyUsingChatGPTinStreamingMode(~)
24
+ ProcessGeneratedTextinRealTimebyUsingChatGPTinStreamingMode ;
25
+ end
26
+
27
+ function testUsingDALLEToGenerateImages(~)
28
+ UsingDALLEToGenerateImages ;
29
+ end
30
+
31
+ function testInformationRetrievalUsingOpenAIDocumentEmbedding(~)
32
+ InformationRetrievalUsingOpenAIDocumentEmbedding ;
33
+ end
34
+
35
+ function testDescribeImagesUsingChatGPT(~)
36
+ DescribeImagesUsingChatGPT ;
37
+ end
38
+
39
+ function testSummarizeLargeDocumentsUsingChatGPTandMATLAB(~)
40
+ SummarizeLargeDocumentsUsingChatGPTandMATLAB ;
41
+ end
42
+
43
+ function testAnalyzeTextDataUsingParallelFunctionCallwithChatGPT(~)
44
+ AnalyzeTextDataUsingParallelFunctionCallwithChatGPT ;
45
+ end
21
46
end
22
47
48
+ end
49
+
50
+ function iCloseAll()
51
+ % Close all opened figures
52
+ allFig = findall(0 , ' type' , ' figure' );
53
+ close(allFig )
23
54
end
0 commit comments