Java: Add wiremock tests (#4859)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
This commit is contained in:
John Oliver
2024-02-05 21:25:13 -05:00
committed by GitHub
parent 11b2421651
commit 48e0b406cc
60 changed files with 1537 additions and 107 deletions
+2
View File
@@ -40,7 +40,9 @@
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<version>1.0-2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
@@ -63,7 +63,7 @@ class XMLPromptParser {
// In this way, we can avoid parsing the whole prompt twice and easily extend the parsing logic.
List<ChatRequestMessage> messages = new ArrayList<>();
try (InputStream is = new ByteArrayInputStream(prompt.getBytes(StandardCharsets.UTF_8))) {
XMLInputFactory factory = XMLInputFactory.newFactory();
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLEventReader reader = factory.createXMLEventReader(is);
while (reader.hasNext()) {
XMLEvent event = reader.nextEvent();
+89 -37
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -14,6 +15,12 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>sample-code</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
@@ -49,47 +56,11 @@
<artifactId>semantickernel-connectors-ai-openai</artifactId>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-planners</artifactId>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>sample-code</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-connectors-memory-jdbc</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-connectors-memory-postgresql</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-connectors-memory-mysql</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-connectors-memory-sqlite</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>org.xerial</groupId>
@@ -124,6 +95,7 @@
<version>3.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
@@ -137,4 +109,84 @@
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<id>recordmappings</id>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Djavax.net.ssl.trustStore=scripts/client.truststore</argument>
<argument>-Djavax.net.ssl.trustStorePassword=password</argument>
</arguments>
<mainClass>com.microsoft.semantickernel.syntaxexamples.WiremockRecord</mainClass>
<classpathScope>test</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>run-wiremocks</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./generateCert.sh</executable>
<workingDirectory>scripts</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<includes>
<include>**/WiremockExamplesIT.java</include>
</includes>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<argLine>
-Djavax.net.ssl.trustStore=scripts/client.truststore
-Djavax.net.ssl.trustStorePassword=password
</argLine>
<environmentVariables>
<AZURE_CLIENT_KEY>foo</AZURE_CLIENT_KEY>
<CLIENT_ENDPOINT>https://localhost:8443/</CLIENT_ENDPOINT>
<PLUGIN_DIR>../../../</PLUGIN_DIR>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
KEYTOOL_ARGS="-noprompt -srcstorepass password -deststorepass password -srckeypass password"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR
if [ -f client.keystore ]; then
exit
fi
rm client.keystore client.truststore server.keystore server.truststore || true
openssl genrsa -out diagserverCA.key 2048
openssl req -x509 -new -nodes -key diagserverCA.key -sha256 -days 1024 -out diagserverCA.pem -subj "/C=US/ST=NA/L=NA/O=NA/OU=NA/CN=localhost"
openssl pkcs12 -export -name server-cert -password pass:password -in diagserverCA.pem -inkey diagserverCA.key -out serverkeystore.p12
openssl genrsa -out diagclientCA.key 2048
openssl req -x509 -new -nodes -key diagclientCA.key -sha256 -days 1024 -out diagclientCA.pem -subj "/C=US/ST=NA/L=NA/O=NA/OU=NA/CN=localhost"
openssl pkcs12 -export -name client-cert -password pass:password -in diagclientCA.pem -inkey diagclientCA.key -out clientkeystore.p12
keytool -importkeystore $KEYTOOL_ARGS -destkeystore server.keystore -srckeystore serverkeystore.p12 -srcstoretype pkcs12 -alias server-cert
keytool -import $KEYTOOL_ARGS -alias client-cert -file diagclientCA.pem -keystore server.truststore
keytool -import $KEYTOOL_ARGS -alias server-cert -file diagserverCA.pem -keystore server.truststore
keytool -importkeystore $KEYTOOL_ARGS -destkeystore client.keystore -srckeystore clientkeystore.p12 -srcstoretype pkcs12 -alias client-cert
keytool -import $KEYTOOL_ARGS -alias server-cert -file diagserverCA.pem -keystore client.truststore
keytool -import $KEYTOOL_ARGS -alias client-cert -file diagclientCA.pem -keystore client.truststore
keytool -importkeystore -srckeystore /usr/lib/jvm/default-java/lib/security/cacerts -destkeystore client.truststore -srcstorepass changeit -deststorepass password
keytool -importkeystore -srckeystore /usr/lib/jvm/default-java/lib/security/cacerts -destkeystore server.truststore -srcstorepass changeit -deststorepass password
rm diagclientCA.key diagserverCA.pem clientkeystore.p12 diagclientCA.pem serverkeystore.p12 diagserverCA.key || true
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# Run this from the api-test/integration-tests directory
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$SCRIPT_DIR/.."
cd $SCRIPT_DIR
if [ ! -f client.truststore ]; then
./generateCert.sh
fi
rm -r "$ROOT_DIR/target/wiremock/mappings" || true
rm -r "$ROOT_DIR/src/test/resources/wiremock/mappings/" || true
mkdir -p "$ROOT_DIR/target/wiremock/mappings"
mkdir -p "$ROOT_DIR/src/test/resources/wiremock/mappings/"
cd $ROOT_DIR
source "$ROOT_DIR/../../.env.record"
export AZURE_CLIENT_KEY
export CLIENT_ENDPOINT
export PLUGIN_DIR="$ROOT_DIR/../../../"
../../mvnw clean package -DskipTests -Pcompile-jdk17
MAVEN_OPTS="-Djavax.net.ssl.trustStore=scripts/client.truststore -Djavax.net.ssl.trustStorePassword=password" \
../../mvnw exec:java@recordmappings -Pcompile-jdk17
for f in $ROOT_DIR/target/wiremock/mappings/*.json; do
cat $f | jq 'del(.response.headers[])' > /tmp/mapping.json
cat /tmp/mapping.json | json_pp > $f
mv $f src/test/resources/wiremock/mappings/
done
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$SCRIPT_DIR/.."
cd $SCRIPT_DIR
if [ ! -f client.truststore ]; then
./generateCert.sh
fi
cd $ROOT_DIR
../../mvnw clean test -Dtest=WiremockExamplesIT -Prun-wiremocks
@@ -4,10 +4,9 @@ package com.microsoft.semantickernel.syntaxexamples;
import com.azure.ai.openai.OpenAIAsyncClient;
import com.azure.ai.openai.OpenAIClientBuilder;
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.microsoft.semantickernel.Kernel;
import com.microsoft.semantickernel.aiservices.openai.textcompletion.OpenAITextGenerationService;
import com.microsoft.semantickernel.orchestration.FunctionResult;
import com.microsoft.semantickernel.orchestration.PromptExecutionSettings;
import com.microsoft.semantickernel.orchestration.contextvariables.KernelArguments;
@@ -19,14 +18,32 @@ import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@WireMockTest
/*
Run this test with the following JVM arguments:
-Djavax.net.ssl.trustStore=scripts/client.truststore
-Djavax.net.ssl.trustStorePassword=password
*/
public class Example05_InlineFunctionDefinitionTest {
@RegisterExtension
static WireMockExtension wm1 = WireMockExtension.newInstance()
.options(WireMockConfiguration.wireMockConfig()
.httpsPort(8443)
.trustStorePath("scripts/client.truststore")
.trustStorePassword("password")
.trustStoreType("jks")
.keystorePath("scripts/server.keystore")
.keystorePassword("password")
.keystoreType("jks"))
.build();
@Test
public void main(WireMockRuntimeInfo wmRuntimeInfo) {
public void main() {
final OpenAIAsyncClient client = new OpenAIClientBuilder()
.endpoint("http://localhost:" + wmRuntimeInfo.getHttpPort())
.endpoint("https://localhost:8443")
.buildAsyncClient();
TextGenerationService textGenerationService = TextGenerationService.builder()
@@ -0,0 +1,128 @@
package com.microsoft.semantickernel.syntaxexamples;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.microsoft.semantickernel.samples.syntaxexamples.Example01_NativeFunctions;
import com.microsoft.semantickernel.samples.syntaxexamples.Example03_Arguments;
import com.microsoft.semantickernel.samples.syntaxexamples.Example05_InlineFunctionDefinition;
import com.microsoft.semantickernel.samples.syntaxexamples.Example06_TemplateLanguage;
import com.microsoft.semantickernel.samples.syntaxexamples.Example09_FunctionTypes;
import com.microsoft.semantickernel.samples.syntaxexamples.Example10_DescribeAllPluginsAndFunctions;
import com.microsoft.semantickernel.samples.syntaxexamples.Example13_ConversationSummaryPlugin;
import com.microsoft.semantickernel.samples.syntaxexamples.Example17_ChatGPT;
import com.microsoft.semantickernel.samples.syntaxexamples.Example27_PromptFunctionsUsingChatGPT;
import com.microsoft.semantickernel.samples.syntaxexamples.Example33_Chat;
import com.microsoft.semantickernel.samples.syntaxexamples.Example41_HttpClientUsage;
import com.microsoft.semantickernel.samples.syntaxexamples.Example43_GetModelResult;
import com.microsoft.semantickernel.samples.syntaxexamples.Example44_MultiChatCompletion;
import com.microsoft.semantickernel.samples.syntaxexamples.Example49_LogitBias;
import com.microsoft.semantickernel.samples.syntaxexamples.Example55_TextChunker;
import com.microsoft.semantickernel.samples.syntaxexamples.Example56_TemplateMethodFunctionsWithMultipleArguments;
import com.microsoft.semantickernel.samples.syntaxexamples.Example57_KernelHooks;
import com.microsoft.semantickernel.samples.syntaxexamples.Example58_ConfigureExecutionSettings;
import com.microsoft.semantickernel.samples.syntaxexamples.Example60_AdvancedMethodFunctions;
import com.microsoft.semantickernel.samples.syntaxexamples.Example61_MultipleLLMs;
import com.microsoft.semantickernel.samples.syntaxexamples.Example62_CustomAIServiceSelector;
import com.microsoft.semantickernel.samples.syntaxexamples.Example63_ChatCompletionPrompts;
import com.microsoft.semantickernel.samples.syntaxexamples.Example64_MultiplePromptTemplates;
import com.microsoft.semantickernel.samples.syntaxexamples.Example69_MutableKernelPlugin;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
public class WiremockExamplesIT {
public static List<Class<?>> mains = Arrays.asList(
Example01_NativeFunctions.class,
Example03_Arguments.class,
Example05_InlineFunctionDefinition.class,
Example06_TemplateLanguage.class,
//Example08_RetryHandler.class,
Example09_FunctionTypes.class,
Example10_DescribeAllPluginsAndFunctions.class,
//Example11_WebSearchQueries.class,
Example13_ConversationSummaryPlugin.class,
Example17_ChatGPT.class,
//Example26_AADAuth.class,
Example27_PromptFunctionsUsingChatGPT.class,
// Difficulty with time causing wiremock to fail
//Example30_ChatWithPrompts.class,
Example33_Chat.class,
Example41_HttpClientUsage.class,
Example43_GetModelResult.class,
Example44_MultiChatCompletion.class,
Example49_LogitBias.class,
Example55_TextChunker.class,
Example56_TemplateMethodFunctionsWithMultipleArguments.class,
Example57_KernelHooks.class,
Example58_ConfigureExecutionSettings.class,
Example60_AdvancedMethodFunctions.class,
Example61_MultipleLLMs.class,
Example62_CustomAIServiceSelector.class,
Example63_ChatCompletionPrompts.class,
Example64_MultiplePromptTemplates.class,
Example69_MutableKernelPlugin.class
);
public static WireMockServer createWiremockServer(String dir) {
return new WireMockServer(
WireMockConfiguration.wireMockConfig()
.httpsPort(8443)
.trustStorePath("scripts/client.truststore")
.trustStorePassword("password")
.trustStoreType("jks")
.keystorePath("scripts/server.keystore")
.keystorePassword("password")
.keystoreType("jks")
.usingFilesUnderDirectory(dir)
);
}
public static void main(String[] args) {
new WiremockExamplesIT()
.runSamplesTest()
.forEach(it -> {
try {
it.getExecutable().execute();
} catch (Throwable e) {
throw new RuntimeException(e);
}
});
}
@TestFactory
public Stream<DynamicTest> runSamplesTest() {
return mains
.stream()
.map(
testClazz -> DynamicTest
.dynamicTest(
testClazz.getSimpleName() + "Test",
() -> {
System.out.println("Running: " + testClazz.getSimpleName());
WireMockServer server = null;
try {
Method main = testClazz.getMethod("main",
String[].class);
server = createWiremockServer("src/test/resources/wiremock");
server.start();
main.invoke(null, new Object[]{null});
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
} finally {
if (server != null) {
server.stop();
}
}
}));
}
}
@@ -0,0 +1,103 @@
package com.microsoft.semantickernel.syntaxexamples;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;
import java.io.IOException;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.UUID;
public class WiremockRecord {
public static void main(String[] args) throws IOException {
record(
() -> {
WiremockExamplesIT.mains.forEach(testClazz -> {
try {
Method main = testClazz.getMethod("main", String[].class);
main.invoke(null, new Object[]{null});
} catch (Exception e) {
throw new RuntimeException(e);
}
});
},
args[0]);
}
public static void compressRecordings(Path mappings) throws IOException {
Files.newDirectoryStream(mappings)
.forEach(path -> {
try {
JsonNode data = new ObjectMapper().readTree(path.toFile());
JsonNode body = new ObjectMapper().readTree(
data.get("response").get("body").asText());
if (body.get("id").asText().contains("chatcmpl-")) {
((ObjectNode) body).put("id", "chatcmpl-xxx");
body
.get("choices")
.forEach(choice -> {
((ObjectNode) choice.get("message")).put("content",
UUID.randomUUID().toString());
});
((ObjectNode) data.get("response")).put("body", body.toString());
} else if (body.get("id").asText().contains("cmpl-")) {
((ObjectNode) body).put("id", "cmpl-xxx");
body
.get("choices")
.forEach(choice -> {
((ObjectNode) choice).put("text", UUID.randomUUID().toString());
});
((ObjectNode) data.get("response")).put("body", body.toString());
}
Files.writeString(path, data.toPrettyString());
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
public static void record(Runnable run, String targetUrl) throws IOException {
Path dir = Path.of("target", "wiremock");
if (dir.toFile().exists()) {
dir.toFile().delete();
}
Files.createDirectories(dir.resolve("mappings"));
System.out.println("Recording to: " + dir.toFile().getCanonicalPath());
WireMockServer wireMockServer = WiremockExamplesIT.createWiremockServer(
dir.toFile().getCanonicalPath() + "/");
wireMockServer.start();
wireMockServer.startRecording(
new RecordSpecBuilder()
.forTarget(targetUrl)
.makeStubsPersistent(true)
.build());
try {
run.run();
} finally {
wireMockServer.stopRecording().getStubMappings();
wireMockServer.stop();
}
compressRecordings(dir.resolve("mappings"));
System.out.println("Saved output to: " + dir.toFile().getAbsolutePath());
}
}
@@ -0,0 +1,24 @@
{
"id" : "80273270-bf63-4ea6-a726-97b378c27206",
"insertionIndex" : 8,
"name" : "deployments_gpt-35-turbo-2_chat_completions",
"newScenarioState" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, what can you do for me?\"}],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo-2\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834148,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"003f4d47-7bc8-4096-b7ee-43c2c62bdc96\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":17,\"completion_tokens\":74,\"total_tokens\":91}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions",
"uuid" : "80273270-bf63-4ea6-a726-97b378c27206"
}
@@ -0,0 +1,24 @@
{
"id" : "8a534347-22a6-449e-8312-e0e251c72a06",
"insertionIndex" : 7,
"name" : "deployments_gpt-35-turbo-2_chat_completions",
"newScenarioState" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions-3",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, what can you do for me?\"}],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo-2\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions-2",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834149,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"length\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"42baccda-fe79-4210-ac3f-b85cd5275578\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":17,\"completion_tokens\":256,\"total_tokens\":273}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions",
"uuid" : "8a534347-22a6-449e-8312-e0e251c72a06"
}
@@ -0,0 +1,21 @@
{
"id" : "afcd8a90-4c00-427e-a6fe-2889c709673a",
"insertionIndex" : 20,
"name" : "deployments_gpt-35-turbo-2_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian expert\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking some suggestions\"}],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{\"39142\":-100,\"17422\":-100,\"35199\":-100,\"56185\":-100,\"2363\":-100,\"23763\":-100,\"35097\":-100,\"1160\":-100,\"47913\":-100,\"58162\":-100,\"1888\":-100,\"2536\":-100,\"79761\":-100,\"3229\":-100,\"12735\":-100,\"301\":-100,\"3446\":-100,\"2653\":-100,\"86831\":-100,\"56741\":-100,\"3773\":-100,\"17649\":-100,\"6875\":-100,\"5403\":-100},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo-2\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834129,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"8763a655-ce84-4493-9333-73e72508d00b\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":23,\"completion_tokens\":46,\"total_tokens\":69}}",
"headers" : { },
"status" : 200
},
"uuid" : "afcd8a90-4c00-427e-a6fe-2889c709673a"
}
@@ -0,0 +1,23 @@
{
"id" : "b287fd2a-66ca-4bf5-8318-46b27dde1ba3",
"insertionIndex" : 5,
"name" : "deployments_gpt-35-turbo-2_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, what can you do for me?\"}],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo-2\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions-3",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834153,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"a8daf2c1-887c-40dc-b3fd-7a9d7fa7f7b2\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":17,\"completion_tokens\":53,\"total_tokens\":70}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-3-deployments-gpt-35-turbo-2-chat-completions",
"uuid" : "b287fd2a-66ca-4bf5-8318-46b27dde1ba3"
}
@@ -0,0 +1,21 @@
{
"id" : "d60c220f-9f80-45dc-9c2c-4d4ac7c5fa32",
"insertionIndex" : 19,
"name" : "deployments_gpt-35-turbo-2_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian expert\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking some suggestions\"},{\"role\":\"assistant\",\"content\":\"Of course! I'd be happy to help you with some suggestions. Can you please provide me with more information about what you're looking for? What genre or type of books are you interested in? Any preferences or specific topics?\"},{\"role\":\"user\",\"content\":\"I love history and philosophy, I'd like to learn something new about Greece, any suggestion\"}],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{\"39142\":-100,\"17422\":-100,\"35199\":-100,\"56185\":-100,\"2363\":-100,\"23763\":-100,\"35097\":-100,\"1160\":-100,\"47913\":-100,\"58162\":-100,\"1888\":-100,\"2536\":-100,\"79761\":-100,\"3229\":-100,\"12735\":-100,\"301\":-100,\"3446\":-100,\"2653\":-100,\"86831\":-100,\"56741\":-100,\"3773\":-100,\"17649\":-100,\"6875\":-100,\"5403\":-100},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo-2\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834130,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"length\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"fe8986c5-c51d-4c24-bfec-9260c510dfbc\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":95,\"completion_tokens\":256,\"total_tokens\":351}}",
"headers" : { },
"status" : 200
},
"uuid" : "d60c220f-9f80-45dc-9c2c-4d4ac7c5fa32"
}
@@ -0,0 +1,21 @@
{
"id" : "005b620b-a3ab-496e-884f-855eaeeba807",
"insertionIndex" : 10,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, what can you do for me?\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834146,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"89bccb3c-194e-4618-b6ac-77ab4d709b4f\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":18,\"completion_tokens\":46,\"total_tokens\":64}}",
"headers" : { },
"status" : 200
},
"uuid" : "005b620b-a3ab-496e-884f-855eaeeba807"
}
@@ -0,0 +1,23 @@
{
"id" : "016ee37f-184f-46d0-a300-c39987eb78bc",
"insertionIndex" : 3,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"What is Seattle?\"},{\"role\":\"system\",\"content\":\"Respond with JSON.\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-2-deployments-gpt-35-turbo-chat-completions-2",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834157,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"e4c24c24-01a2-43dc-970a-667a26bdb873\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":132,\"total_tokens\":153}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-2-deployments-gpt-35-turbo-chat-completions",
"uuid" : "016ee37f-184f-46d0-a300-c39987eb78bc"
}
@@ -0,0 +1,23 @@
{
"id" : "1f9bb4da-15dd-464a-a46c-386ffc4459e7",
"insertionIndex" : 1,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, my name is Bob. What is the origin of my name?\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-1-deployments-gpt-35-turbo-chat-completions-2",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834160,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"c39a8134-9579-497a-a009-0f9ecb21dbff\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":32,\"total_tokens\":56}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-1-deployments-gpt-35-turbo-chat-completions",
"uuid" : "1f9bb4da-15dd-464a-a46c-386ffc4459e7"
}
@@ -0,0 +1,21 @@
{
"id" : "22035813-f748-470e-bfca-d655d0295a30",
"insertionIndex" : 25,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"List the two planets closest to 'Jupiter', excluding moons, using bullet points.\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834119,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"2a44f317-f124-44a2-a191-3e48a736ca05\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":25,\"completion_tokens\":6,\"total_tokens\":31}}",
"headers" : { },
"status" : 200
},
"uuid" : "22035813-f748-470e-bfca-d655d0295a30"
}
@@ -0,0 +1,24 @@
{
"id" : "3097698c-da33-491e-8462-274369fe04ea",
"insertionIndex" : 27,
"name" : "deployments_gpt-35-turbo_chat_completions",
"newScenarioState" : "scenario-6-deployments-gpt-35-turbo-chat-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian, expert about books\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking for book suggestions\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834114,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"e66d2f80-627b-4621-a9b2-3fb178039ed0\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":29,\"completion_tokens\":42,\"total_tokens\":71}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-6-deployments-gpt-35-turbo-chat-completions",
"uuid" : "3097698c-da33-491e-8462-274369fe04ea"
}
@@ -0,0 +1,21 @@
{
"id" : "3263345f-be02-49fa-bd66-2915c1fde1d0",
"insertionIndex" : 22,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hi, give me 5 book suggestions about: travel\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834122,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"3723a3ef-b83f-4df1-9313-40cc01bea801\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":19,\"completion_tokens\":136,\"total_tokens\":155}}",
"headers" : { },
"status" : 200
},
"uuid" : "3263345f-be02-49fa-bd66-2915c1fde1d0"
}
@@ -0,0 +1,21 @@
{
"id" : "38a4bb8e-5955-454a-ab41-ab7c7c84796c",
"insertionIndex" : 23,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian, expert about books\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking for book suggestions\"},{\"role\":\"assistant\",\"content\":\"Sure, I'd be happy to help! What type of book are you in the mood for? Fiction or non-fiction? Any specific genres that interest you?\"},{\"role\":\"user\",\"content\":\"I love history and philosophy, I'd like to learn something new about Greece, any suggestion\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834120,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"3df99e6f-d4b5-41d7-a6ee-fdacc35553e8\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":89,\"completion_tokens\":70,\"total_tokens\":159}}",
"headers" : { },
"status" : 200
},
"uuid" : "38a4bb8e-5955-454a-ab41-ab7c7c84796c"
}
@@ -0,0 +1,21 @@
{
"id" : "3d3c6b8b-7d76-4a56-bf61-754d5ec1fa15",
"insertionIndex" : 16,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a random paragraph about: I missed the F1 final race in the style of Seinfeld.\\nUSE SHORT, CLEAR, COMPLETE SENTENCES.\"}],\"max_tokens\":100,\"temperature\":0.4,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834136,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"length\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"fddf7581-2c8f-4fec-a815-bb01af352b6a\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":37,\"completion_tokens\":100,\"total_tokens\":137}}",
"headers" : { },
"status" : 200
},
"uuid" : "3d3c6b8b-7d76-4a56-bf61-754d5ec1fa15"
}
@@ -0,0 +1,21 @@
{
"id" : "460b6d23-f865-479f-a9e3-7e77d771574e",
"insertionIndex" : 26,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian, expert about books\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking for book suggestions\"},{\"role\":\"assistant\",\"content\":\"Sure, I'd be happy to help! Can you tell me what kind of books you're interested in? Fiction or non-fiction? A specific genre? Any authors or books you've enjoyed in the past?\"},{\"role\":\"user\",\"content\":\"I love history and philosophy, I'd like to learn something new about Greece, any suggestion\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834115,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"a3879540-dc0e-4c23-abb0-ee463aa64b96\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":99,\"completion_tokens\":221,\"total_tokens\":320}}",
"headers" : { },
"status" : 200
},
"uuid" : "460b6d23-f865-479f-a9e3-7e77d771574e"
}
@@ -0,0 +1,24 @@
{
"id" : "48f17a4b-a1bf-419a-882b-7fb4a28f3597",
"insertionIndex" : 4,
"name" : "deployments_gpt-35-turbo_chat_completions",
"newScenarioState" : "scenario-2-deployments-gpt-35-turbo-chat-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"What is Seattle?\"},{\"role\":\"system\",\"content\":\"Respond with JSON.\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834155,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"33b7c165-82a4-47e1-b801-131db6526913\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":119,\"total_tokens\":140}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-2-deployments-gpt-35-turbo-chat-completions",
"uuid" : "48f17a4b-a1bf-419a-882b-7fb4a28f3597"
}
@@ -0,0 +1,23 @@
{
"id" : "48fea358-dd01-44f5-bf3a-fdf8cd171e55",
"insertionIndex" : 24,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian, expert about books\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking for book suggestions\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-6-deployments-gpt-35-turbo-chat-completions-2",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834119,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"42bfdcee-39a2-491d-bd96-6494469f3982\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":29,\"completion_tokens\":32,\"total_tokens\":61}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-6-deployments-gpt-35-turbo-chat-completions",
"uuid" : "48fea358-dd01-44f5-bf3a-fdf8cd171e55"
}
@@ -0,0 +1,21 @@
{
"id" : "4fc21523-e803-4523-9cc8-78c386cb83cb",
"insertionIndex" : 17,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a random paragraph about: I missed the F1 final race.\"}],\"max_tokens\":100,\"temperature\":0.4,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834135,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"length\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"4ee73b51-075d-48a6-8d25-0b1f8a9a7f46\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":22,\"completion_tokens\":100,\"total_tokens\":122}}",
"headers" : { },
"status" : 200
},
"uuid" : "4fc21523-e803-4523-9cc8-78c386cb83cb"
}
@@ -0,0 +1,24 @@
{
"id" : "53426f33-03a5-464e-93b7-27dd1c00ca41",
"insertionIndex" : 13,
"name" : "deployments_gpt-35-turbo_chat_completions",
"newScenarioState" : "scenario-5-deployments-gpt-35-turbo-chat-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a paragraph about hats\"},{\"role\":\"system\",\"content\":\"Use upper case text when responding to the prompt.\"}],\"max_tokens\":1000,\"temperature\":1.0,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834140,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"8d245a7d-9c86-4ffc-a336-36e2a5b1b1cc\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":28,\"completion_tokens\":160,\"total_tokens\":188}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-5-deployments-gpt-35-turbo-chat-completions",
"uuid" : "53426f33-03a5-464e-93b7-27dd1c00ca41"
}
@@ -0,0 +1,21 @@
{
"id" : "547fcddc-e0ea-4ebc-a6e5-116ba6388a96",
"insertionIndex" : 21,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"assistant\",\"content\":\"You are a librarian, expert about books\"},{\"role\":\"user\",\"content\":\"Hi, I'm looking for 3 different book suggestions about sci-fi\"}],\"max_tokens\":1024,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":2,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834125,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"563bcc98-b0bd-4454-818b-693e5058f287\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"low\"}}},{\"finish_reason\":\"stop\",\"index\":1,\"message\":{\"role\":\"assistant\",\"content\":\"82689182-eea2-41b2-b9b6-b62190acaba0\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":35,\"completion_tokens\":458,\"total_tokens\":493}}",
"headers" : { },
"status" : 200
},
"uuid" : "547fcddc-e0ea-4ebc-a6e5-116ba6388a96"
}
@@ -0,0 +1,23 @@
{
"id" : "63e32274-0eb9-486b-a740-d204963a1921",
"insertionIndex" : 12,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a paragraph about hats\"},{\"role\":\"system\",\"content\":\"Use upper case text when responding to the prompt.\"}],\"max_tokens\":1000,\"temperature\":1.0,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-5-deployments-gpt-35-turbo-chat-completions-2",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834142,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"127ef539-b009-48a8-ad11-1ac02a0acb9f\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":28,\"completion_tokens\":165,\"total_tokens\":193}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-5-deployments-gpt-35-turbo-chat-completions",
"uuid" : "63e32274-0eb9-486b-a740-d204963a1921"
}
@@ -0,0 +1,24 @@
{
"id" : "8d24484b-28a8-4dfb-8ea8-3098f013e7b9",
"insertionIndex" : 2,
"name" : "deployments_gpt-35-turbo_chat_completions",
"newScenarioState" : "scenario-1-deployments-gpt-35-turbo-chat-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, my name is Bob. What is the origin of my name?\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834159,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"4d48cee2-a5cf-47e3-b098-c363ef41fa4a\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":49,\"total_tokens\":73}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-1-deployments-gpt-35-turbo-chat-completions",
"uuid" : "8d24484b-28a8-4dfb-8ea8-3098f013e7b9"
}
@@ -0,0 +1,21 @@
{
"id" : "8e1a79d7-8b2d-49d9-a4b6-1af619d23972",
"insertionIndex" : 15,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a paragraph about Handlers.\"}],\"max_tokens\":100,\"temperature\":0.4,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834138,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"length\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"8112a34b-8713-4ac1-94ab-73cbce4afba0\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":14,\"completion_tokens\":100,\"total_tokens\":114}}",
"headers" : { },
"status" : 200
},
"uuid" : "8e1a79d7-8b2d-49d9-a4b6-1af619d23972"
}
@@ -0,0 +1,21 @@
{
"id" : "db15fdb3-7258-4a62-8877-7a23deff3483",
"insertionIndex" : 14,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a phrase with Cancellation.\"}],\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834139,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"b5e465e1-e745-41ae-bb4b-8e38448bfe71\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":15,\"completion_tokens\":9,\"total_tokens\":24}}",
"headers" : { },
"status" : 200
},
"uuid" : "db15fdb3-7258-4a62-8877-7a23deff3483"
}
@@ -0,0 +1,21 @@
{
"id" : "f38fccbd-0526-4d8c-ab2c-bc1bd945292c",
"insertionIndex" : 18,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Write a haiku about the following: Harry Potter\"}],\"max_tokens\":100,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834134,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"dc4da588-5ebe-4d15-b586-edd28fff1ce4\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":18,\"completion_tokens\":29,\"total_tokens\":47}}",
"headers" : { },
"status" : 200
},
"uuid" : "f38fccbd-0526-4d8c-ab2c-bc1bd945292c"
}
@@ -0,0 +1,21 @@
{
"id" : "f66a56a2-e9ca-4f8b-88cb-b1748bc3156e",
"insertionIndex" : 11,
"name" : "deployments_gpt-35-turbo_chat_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"messages\":[{\"role\":\"user\",\"content\":\"Hello AI, what can you do for me?\"}],\"max_tokens\":60,\"temperature\":0.7,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"model\":\"gpt-35-turbo\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1706834145,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"039898f6-a204-4203-82c6-e1082d25aff4\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":18,\"completion_tokens\":41,\"total_tokens\":59}}",
"headers" : { },
"status" : 200
},
"uuid" : "f66a56a2-e9ca-4f8b-88cb-b1748bc3156e"
}
@@ -0,0 +1,21 @@
{
"id" : "25f23187-2ccd-4365-ac5f-4c34f9cb1df7",
"insertionIndex" : 35,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Translate this date 1970-01-01 to French format\"],\"max_tokens\":100,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834099,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"71aea285-d376-4526-8b85-b54640a02de3\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":12,\"completion_tokens\":8,\"total_tokens\":20}}",
"headers" : { },
"status" : 200
},
"uuid" : "25f23187-2ccd-4365-ac5f-4c34f9cb1df7"
}
@@ -0,0 +1,24 @@
{
"id" : "53c9bc60-38e1-43ee-bc41-72c4c8e0c132",
"insertionIndex" : 9,
"name" : "deployments_text-davinci-003_completions",
"newScenarioState" : "scenario-4-deployments-text-davinci-003-completions-2",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Hello AI, what can you do for me?\"],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "Started",
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834147,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"c7393b1a-90a5-4225-9e8b-21beda1181fb\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":21,\"total_tokens\":31}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-4-deployments-text-davinci-003-completions",
"uuid" : "53c9bc60-38e1-43ee-bc41-72c4c8e0c132"
}
@@ -0,0 +1,21 @@
{
"id" : "6e1f75c1-ff79-4c2f-8aa2-21d3bb9b657c",
"insertionIndex" : 29,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Analyze the following extract taken from a conversation transcript and extract key topics.\\n- Topics only worth remembering.\\n- Be brief. Short phrases.\\n- Can use broken English.\\n- Conciseness is very important.\\n- Topics can include names of memories you want to recall.\\n- NO LONG SENTENCES. SHORT PHRASES.\\n- Return in JSON\\n[Input]\\nMy name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest.\\nMy tragic story was immortalized by Shakespeare in a play.\\n[Output]\\n{\\n \\\"topics\\\": [\\n \\\"Macbeth\\\",\\n \\\"King of Scotland\\\",\\n \\\"Lady Macbeth\\\",\\n \\\"Dog\\\",\\n \\\"Toby McDuff\\\",\\n \\\"Shakespeare\\\",\\n \\\"Play\\\",\\n \\\"Tragedy\\\"\\n ]\\n}\\n+++++\\n[Input]\\nJohn: Hello, how are you?\\nJane: I'm fine, thanks. How are you?\\nJohn: I'm doing well, writing some example code.\\nJane: That's great! I'm writing some example code too.\\nJohn: What are you writing?\\nJane: I'm writing a chatbot.\\nJohn: That's cool. I'm writing a chatbot too.\\nJane: What language are you writing it in?\\nJohn: I'm writing it in C#.\\nJane: I'm writing it in Python.\\nJohn: That's cool. I need to learn Python.\\nJane: I need to learn C#.\\nJohn: Can I try out your chatbot?\\nJane: Sure, here's the link.\\nJohn: Thanks!\\nJane: You're welcome.\\nJane: Look at this poem my chatbot wrote:\\nJane: Roses are red\\nJane: Violets are blue\\nJane: I'm writing a chatbot\\nJane: What about you?\\nJohn: That's cool. Let me see if mine will write a poem, too.\\nJohn: Here's a poem my chatbot wrote:\\nJohn: The singularity of the universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Looks like I need to improve mine, oh well.\\nJane: You might want to try using a different model.\\nJane: I'm using the GPT-3 model.\\nJohn: I'm using the GPT-2 model. That makes sense.\\nJohn: Here is a new poem after updating the model.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Yikes, it's really stuck isn't it. Would you help me debug my code?\\nJane: Sure, what's the problem?\\nJohn: I'm not sure. I think it's a bug in the code.\\nJane: I'll take a look.\\nJane: I think I found the problem.\\nJane: It looks like you're not passing the right parameters to the model.\\nJohn: Thanks for the help!\\nJane: I'm now writing a bot to summarize conversations. I want to make sure it works when the conversation is long.\\nJohn: So you need to keep talking with me to generate a long conversation?\\nJane: Yes, that's right.\\nJohn: Ok, I'll keep talking. What should we talk about?\\nJane: I don't know, what do you want to talk about?\\nJohn: I don't know, it's nice how CoPilot is doing most of the talking for us. But it definitely gets stuck sometimes.\\nJane: I agree, it's nice that CoPilot is doing most of the talking for us.\\nJane: But it definitely gets stuck sometimes.\\nJohn: Do you know how long it needs to be?\\nJane: I think the max length is 1024 tokens. Which is approximately 1024*4= 4096 characters.\\nJohn: That's a lot of characters.\\nJane: Yes, it is.\\nJohn: I'm not sure how much longer I can keep talking.\\n[Output]\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834110,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"33adccb8-4f4e-4bcf-b2de-e7e3632f6f4d\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":927,\"completion_tokens\":77,\"total_tokens\":1004}}",
"headers" : { },
"status" : 200
},
"uuid" : "6e1f75c1-ff79-4c2f-8aa2-21d3bb9b657c"
}
@@ -0,0 +1,21 @@
{
"id" : "713b4915-450e-40a6-bd95-59d39067d220",
"insertionIndex" : 36,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\" Generate a creative reason or excuse for the given event.\\n Be creative and be funny. Let your imagination run wild.\\n\\n Event: I am running late.\\n Excuse: I was being held ransom by giraffe gangsters.\\n\\n Event: I haven't been to the gym for a year\\n Excuse: I've been too busy training my pet dragon.\\n\\n Event: sorry I forgot your birthday\\n\"],\"max_tokens\":100,\"temperature\":0.4,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834099,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"1291ecae-7eb5-446b-8244-0f4835213416\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"low\"}}}],\"usage\":{\"prompt_tokens\":91,\"completion_tokens\":23,\"total_tokens\":114}}",
"headers" : { },
"status" : 200
},
"uuid" : "713b4915-450e-40a6-bd95-59d39067d220"
}
@@ -0,0 +1,21 @@
{
"id" : "79dc9a6e-6e4b-452b-91ed-b441a44d62be",
"insertionIndex" : 30,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"You are an action item extractor. You will be given chat history and need to make note of action items mentioned in the chat.\\nExtract action items from the content if there are any. If there are no action, return nothing. If a single field is missing, use an empty string.\\nReturn the action items in json.\\n\\nPossible statuses for action items are: Open, Closed, In Progress.\\n\\nEXAMPLE INPUT WITH ACTION ITEMS:\\n\\nJohn Doe said: \\\"I will record a demo for the new feature by Friday\\\"\\nI said: \\\"Great, thanks John. We may not use all of it but it's good to get it out there.\\\"\\n\\nEXAMPLE OUTPUT:\\n{\\n \\\"actionItems\\\": [\\n {\\n \\\"owner\\\": \\\"John Doe\\\",\\n \\\"actionItem\\\": \\\"Record a demo for the new feature\\\",\\n \\\"dueDate\\\": \\\"Friday\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"notes\\\": \\\"\\n }\\n ]\\n}\\n\\nEXAMPLE INPUT WITHOUT ACTION ITEMS:\\n\\nJohn Doe said: \\\"Hey I'm going to the store, do you need anything?\\\"\\nI said: \\\"No thanks, I'm good.\\\"\\n\\nEXAMPLE OUTPUT:\\n{\\n \\\"action_items\\\": []\\n}\\n\\nCONTENT STARTS HERE.\\n\\nJane: I think we're almost there. Let me check.\\nJane: I have some bad news, we're only half way there.\\nJohn: Oh no, I'm not sure I can keep going. I'm getting tired.\\nJane: I'm getting tired too.\\nJohn: Maybe there is a large piece of text we can use to generate a long conversation.\\nJane: That's a good idea. Let me see if I can find one. Maybe Lorem Ipsum?\\nJohn: Yeah, that's a good idea.\\nJane: I found a Lorem Ipsum generator.\\nJane: Here's a 4096 character Lorem Ipsum text:\\nJane: Lorem ipsum dolor sit amet, con\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Darn, it's just repeating stuf now.\\nJohn: I think we're done.\\nJane: We're not though! We need like 1500 more characters.\\nJohn: Oh Cananda, our home and native land.\\nJane: True patriot love in all thy sons command.\\nJohn: With glowing hearts we see thee rise.\\nJane: The True North strong and free.\\nJohn: From far and wide, O Canada, we stand on guard for thee.\\nJane: God keep our land glorious and free.\\nJohn: O Canada, we stand on guard for thee.\\nJane: O Canada, we stand on guard for thee.\\nJane: That was fun, thank you. Let me check now.\\nJane: I think we need about 600 more characters.\\nJohn: Oh say can you see?\\nJane: By the dawn's early light.\\nJohn: What so proudly we hailed.\\nJane: At the twilight's last gleaming.\\nJohn: Whose broad stripes and bright stars.\\nJane: Through the perilous fight.\\nJohn: O'er the ramparts we watched.\\nJane: Were so gallantly streaming.\\nJohn: And the rockets' red glare.\\nJane: The bombs bursting in air.\\nJohn: Gave proof through the night.\\nJane: That our flag was still there.\\nJohn: Oh say does that star-spangled banner yet wave.\\nJane: O'er the land of the free.\\nJohn: And the home of the brave.\\nJane: Are you a Seattle Kraken Fan?\\nJohn: Yes, I am. I love going to the games.\\nJane: I'm a Seattle Kraken Fan too. Who is your favorite player?\\nJohn: I like watching all the players, but I think my favorite is Matty Beniers.\\nJane: Yeah, he's a great player. I like watching him too. I also like watching Jaden Schwartz.\\nJohn: Adam Larsson is another good one. The big cat!\\nJane: WE MADE IT! It's long enough. Thank you!\\nJohn: Can you automate generating long text next time?\\nJane: I will.\\nJohn: You're welcome. I'm glad we could help. Goodbye!\\nJane: Goodbye!\\n\\nCONTENT STOPS HERE.\\n\\nOUTPUT:\\n\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834109,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"a7678552-d24f-4424-b57f-35db44f8d320\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":1018,\"completion_tokens\":62,\"total_tokens\":1080}}",
"headers" : { },
"status" : 200
},
"uuid" : "79dc9a6e-6e4b-452b-91ed-b441a44d62be"
}
@@ -0,0 +1,23 @@
{
"id" : "7b007608-4004-4b4a-97fc-17b824be79d7",
"insertionIndex" : 6,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Hello AI, what can you do for me?\"],\"max_tokens\":256,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"requiredScenarioState" : "scenario-4-deployments-text-davinci-003-completions-2",
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834152,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"c1a3e3d1-0ca9-48cb-9685-781d5ee7e31c\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":46,\"total_tokens\":56}}",
"headers" : { },
"status" : 200
},
"scenarioName" : "scenario-4-deployments-text-davinci-003-completions",
"uuid" : "7b007608-4004-4b4a-97fc-17b824be79d7"
}
@@ -0,0 +1,21 @@
{
"id" : "b946d010-8f1e-446a-aa88-1d5abc29099c",
"insertionIndex" : 28,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Analyze the following extract taken from a conversation transcript and extract key topics.\\n- Topics only worth remembering.\\n- Be brief. Short phrases.\\n- Can use broken English.\\n- Conciseness is very important.\\n- Topics can include names of memories you want to recall.\\n- NO LONG SENTENCES. SHORT PHRASES.\\n- Return in JSON\\n[Input]\\nMy name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest.\\nMy tragic story was immortalized by Shakespeare in a play.\\n[Output]\\n{\\n \\\"topics\\\": [\\n \\\"Macbeth\\\",\\n \\\"King of Scotland\\\",\\n \\\"Lady Macbeth\\\",\\n \\\"Dog\\\",\\n \\\"Toby McDuff\\\",\\n \\\"Shakespeare\\\",\\n \\\"Play\\\",\\n \\\"Tragedy\\\"\\n ]\\n}\\n+++++\\n[Input]\\nJane: I think we're almost there. Let me check.\\nJane: I have some bad news, we're only half way there.\\nJohn: Oh no, I'm not sure I can keep going. I'm getting tired.\\nJane: I'm getting tired too.\\nJohn: Maybe there is a large piece of text we can use to generate a long conversation.\\nJane: That's a good idea. Let me see if I can find one. Maybe Lorem Ipsum?\\nJohn: Yeah, that's a good idea.\\nJane: I found a Lorem Ipsum generator.\\nJane: Here's a 4096 character Lorem Ipsum text:\\nJane: Lorem ipsum dolor sit amet, con\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Darn, it's just repeating stuf now.\\nJohn: I think we're done.\\nJane: We're not though! We need like 1500 more characters.\\nJohn: Oh Cananda, our home and native land.\\nJane: True patriot love in all thy sons command.\\nJohn: With glowing hearts we see thee rise.\\nJane: The True North strong and free.\\nJohn: From far and wide, O Canada, we stand on guard for thee.\\nJane: God keep our land glorious and free.\\nJohn: O Canada, we stand on guard for thee.\\nJane: O Canada, we stand on guard for thee.\\nJane: That was fun, thank you. Let me check now.\\nJane: I think we need about 600 more characters.\\nJohn: Oh say can you see?\\nJane: By the dawn's early light.\\nJohn: What so proudly we hailed.\\nJane: At the twilight's last gleaming.\\nJohn: Whose broad stripes and bright stars.\\nJane: Through the perilous fight.\\nJohn: O'er the ramparts we watched.\\nJane: Were so gallantly streaming.\\nJohn: And the rockets' red glare.\\nJane: The bombs bursting in air.\\nJohn: Gave proof through the night.\\nJane: That our flag was still there.\\nJohn: Oh say does that star-spangled banner yet wave.\\nJane: O'er the land of the free.\\nJohn: And the home of the brave.\\nJane: Are you a Seattle Kraken Fan?\\nJohn: Yes, I am. I love going to the games.\\nJane: I'm a Seattle Kraken Fan too. Who is your favorite player?\\nJohn: I like watching all the players, but I think my favorite is Matty Beniers.\\nJane: Yeah, he's a great player. I like watching him too. I also like watching Jaden Schwartz.\\nJohn: Adam Larsson is another good one. The big cat!\\nJane: WE MADE IT! It's long enough. Thank you!\\nJohn: Can you automate generating long text next time?\\nJane: I will.\\nJohn: You're welcome. I'm glad we could help. Goodbye!\\nJane: Goodbye!\\n[Output]\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834112,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"1782fa16-5e6a-436e-a9e6-884307845d19\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":947,\"completion_tokens\":56,\"total_tokens\":1003}}",
"headers" : { },
"status" : 200
},
"uuid" : "b946d010-8f1e-446a-aa88-1d5abc29099c"
}
@@ -0,0 +1,21 @@
{
"id" : "bb5c976d-a431-4026-b142-cbc87e62f60c",
"insertionIndex" : 32,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"BEGIN CONTENT TO SUMMARIZE:\\nJane: I think we're almost there. Let me check.\\nJane: I have some bad news, we're only half way there.\\nJohn: Oh no, I'm not sure I can keep going. I'm getting tired.\\nJane: I'm getting tired too.\\nJohn: Maybe there is a large piece of text we can use to generate a long conversation.\\nJane: That's a good idea. Let me see if I can find one. Maybe Lorem Ipsum?\\nJohn: Yeah, that's a good idea.\\nJane: I found a Lorem Ipsum generator.\\nJane: Here's a 4096 character Lorem Ipsum text:\\nJane: Lorem ipsum dolor sit amet, con\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc sit amet aliquam\\nJane: Darn, it's just repeating stuf now.\\nJohn: I think we're done.\\nJane: We're not though! We need like 1500 more characters.\\nJohn: Oh Cananda, our home and native land.\\nJane: True patriot love in all thy sons command.\\nJohn: With glowing hearts we see thee rise.\\nJane: The True North strong and free.\\nJohn: From far and wide, O Canada, we stand on guard for thee.\\nJane: God keep our land glorious and free.\\nJohn: O Canada, we stand on guard for thee.\\nJane: O Canada, we stand on guard for thee.\\nJane: That was fun, thank you. Let me check now.\\nJane: I think we need about 600 more characters.\\nJohn: Oh say can you see?\\nJane: By the dawn's early light.\\nJohn: What so proudly we hailed.\\nJane: At the twilight's last gleaming.\\nJohn: Whose broad stripes and bright stars.\\nJane: Through the perilous fight.\\nJohn: O'er the ramparts we watched.\\nJane: Were so gallantly streaming.\\nJohn: And the rockets' red glare.\\nJane: The bombs bursting in air.\\nJohn: Gave proof through the night.\\nJane: That our flag was still there.\\nJohn: Oh say does that star-spangled banner yet wave.\\nJane: O'er the land of the free.\\nJohn: And the home of the brave.\\nJane: Are you a Seattle Kraken Fan?\\nJohn: Yes, I am. I love going to the games.\\nJane: I'm a Seattle Kraken Fan too. Who is your favorite player?\\nJohn: I like watching all the players, but I think my favorite is Matty Beniers.\\nJane: Yeah, he's a great player. I like watching him too. I also like watching Jaden Schwartz.\\nJohn: Adam Larsson is another good one. The big cat!\\nJane: WE MADE IT! It's long enough. Thank you!\\nJohn: Can you automate generating long text next time?\\nJane: I will.\\nJohn: You're welcome. I'm glad we could help. Goodbye!\\nJane: Goodbye!\\n\\nEND CONTENT TO SUMMARIZE.\\n\\nSummarize the conversation in 'CONTENT TO SUMMARIZE', identifying main points of discussion and any conclusions that were reached.\\nDo not incorporate other general knowledge.\\nSummary is in plain text, in complete sentences, with no markup or tags.\\n\\nBEGIN SUMMARY:\\n\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834104,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"be511440-5116-42d2-9d71-dd3887828d1a\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":791,\"completion_tokens\":55,\"total_tokens\":846}}",
"headers" : { },
"status" : 200
},
"uuid" : "bb5c976d-a431-4026-b142-cbc87e62f60c"
}
@@ -0,0 +1,21 @@
{
"id" : "bfa8b606-15ca-4096-ac0d-adbce5b0cbfd",
"insertionIndex" : 34,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"Today is: 2021-09-01\\nCurrent time is: 12:00:00\\n\\nAnswer to the following questions using JSON syntax, including the data used.\\n Is it morning, afternoon, evening, or night (morning/afternoon/evening/night)?\\n Is it weekend time (weekend/not weekend)?\\n\"],\"max_tokens\":100,\"temperature\":1.0,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834100,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"874ed76a-5ecd-4832-a556-bb256fe6e833\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":71,\"completion_tokens\":48,\"total_tokens\":119}}",
"headers" : { },
"status" : 200
},
"uuid" : "bfa8b606-15ca-4096-ac0d-adbce5b0cbfd"
}
@@ -0,0 +1,21 @@
{
"id" : "c94e0c39-6013-4230-9ac9-d5b9d397ef71",
"insertionIndex" : 33,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"BEGIN CONTENT TO SUMMARIZE:\\nJohn: Hello, how are you?\\nJane: I'm fine, thanks. How are you?\\nJohn: I'm doing well, writing some example code.\\nJane: That's great! I'm writing some example code too.\\nJohn: What are you writing?\\nJane: I'm writing a chatbot.\\nJohn: That's cool. I'm writing a chatbot too.\\nJane: What language are you writing it in?\\nJohn: I'm writing it in C#.\\nJane: I'm writing it in Python.\\nJohn: That's cool. I need to learn Python.\\nJane: I need to learn C#.\\nJohn: Can I try out your chatbot?\\nJane: Sure, here's the link.\\nJohn: Thanks!\\nJane: You're welcome.\\nJane: Look at this poem my chatbot wrote:\\nJane: Roses are red\\nJane: Violets are blue\\nJane: I'm writing a chatbot\\nJane: What about you?\\nJohn: That's cool. Let me see if mine will write a poem, too.\\nJohn: Here's a poem my chatbot wrote:\\nJohn: The singularity of the universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Looks like I need to improve mine, oh well.\\nJane: You might want to try using a different model.\\nJane: I'm using the GPT-3 model.\\nJohn: I'm using the GPT-2 model. That makes sense.\\nJohn: Here is a new poem after updating the model.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Yikes, it's really stuck isn't it. Would you help me debug my code?\\nJane: Sure, what's the problem?\\nJohn: I'm not sure. I think it's a bug in the code.\\nJane: I'll take a look.\\nJane: I think I found the problem.\\nJane: It looks like you're not passing the right parameters to the model.\\nJohn: Thanks for the help!\\nJane: I'm now writing a bot to summarize conversations. I want to make sure it works when the conversation is long.\\nJohn: So you need to keep talking with me to generate a long conversation?\\nJane: Yes, that's right.\\nJohn: Ok, I'll keep talking. What should we talk about?\\nJane: I don't know, what do you want to talk about?\\nJohn: I don't know, it's nice how CoPilot is doing most of the talking for us. But it definitely gets stuck sometimes.\\nJane: I agree, it's nice that CoPilot is doing most of the talking for us.\\nJane: But it definitely gets stuck sometimes.\\nJohn: Do you know how long it needs to be?\\nJane: I think the max length is 1024 tokens. Which is approximately 1024*4= 4096 characters.\\nJohn: That's a lot of characters.\\nJane: Yes, it is.\\nJohn: I'm not sure how much longer I can keep talking.\\n\\nEND CONTENT TO SUMMARIZE.\\n\\nSummarize the conversation in 'CONTENT TO SUMMARIZE', identifying main points of discussion and any conclusions that were reached.\\nDo not incorporate other general knowledge.\\nSummary is in plain text, in complete sentences, with no markup or tags.\\n\\nBEGIN SUMMARY:\\n\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834102,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"9dbd661d-69c2-4839-9934-0d6e6d578da9\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":771,\"completion_tokens\":71,\"total_tokens\":842}}",
"headers" : { },
"status" : 200
},
"uuid" : "c94e0c39-6013-4230-9ac9-d5b9d397ef71"
}
@@ -0,0 +1,21 @@
{
"id" : "ebdb09a0-2362-444e-ae20-6a059ae86631",
"insertionIndex" : 37,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\" Generate a creative reason or excuse for the given event.\\n Be creative and be funny. Let your imagination run wild.\\n\\n Event: I am running late.\\n Excuse: I was being held ransom by giraffe gangsters.\\n\\n Event: I haven't been to the gym for a year\\n Excuse: I've been too busy training my pet dragon.\\n\\n Event: I missed the F1 final race\\n\"],\"max_tokens\":100,\"temperature\":0.4,\"top_p\":1.0,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834098,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"29736d86-096e-4f81-9b0c-a2bd61300c54\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":93,\"completion_tokens\":18,\"total_tokens\":111}}",
"headers" : { },
"status" : 200
},
"uuid" : "ebdb09a0-2362-444e-ae20-6a059ae86631"
}
@@ -0,0 +1,21 @@
{
"id" : "ff557508-e079-47f6-9b97-c393faec9812",
"insertionIndex" : 31,
"name" : "deployments_text-davinci-003_completions",
"persistent" : true,
"request" : {
"bodyPatterns" : [ {
"equalToJson" : "{\"prompt\":[\"You are an action item extractor. You will be given chat history and need to make note of action items mentioned in the chat.\\nExtract action items from the content if there are any. If there are no action, return nothing. If a single field is missing, use an empty string.\\nReturn the action items in json.\\n\\nPossible statuses for action items are: Open, Closed, In Progress.\\n\\nEXAMPLE INPUT WITH ACTION ITEMS:\\n\\nJohn Doe said: \\\"I will record a demo for the new feature by Friday\\\"\\nI said: \\\"Great, thanks John. We may not use all of it but it's good to get it out there.\\\"\\n\\nEXAMPLE OUTPUT:\\n{\\n \\\"actionItems\\\": [\\n {\\n \\\"owner\\\": \\\"John Doe\\\",\\n \\\"actionItem\\\": \\\"Record a demo for the new feature\\\",\\n \\\"dueDate\\\": \\\"Friday\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"notes\\\": \\\"\\n }\\n ]\\n}\\n\\nEXAMPLE INPUT WITHOUT ACTION ITEMS:\\n\\nJohn Doe said: \\\"Hey I'm going to the store, do you need anything?\\\"\\nI said: \\\"No thanks, I'm good.\\\"\\n\\nEXAMPLE OUTPUT:\\n{\\n \\\"action_items\\\": []\\n}\\n\\nCONTENT STARTS HERE.\\n\\nJohn: Hello, how are you?\\nJane: I'm fine, thanks. How are you?\\nJohn: I'm doing well, writing some example code.\\nJane: That's great! I'm writing some example code too.\\nJohn: What are you writing?\\nJane: I'm writing a chatbot.\\nJohn: That's cool. I'm writing a chatbot too.\\nJane: What language are you writing it in?\\nJohn: I'm writing it in C#.\\nJane: I'm writing it in Python.\\nJohn: That's cool. I need to learn Python.\\nJane: I need to learn C#.\\nJohn: Can I try out your chatbot?\\nJane: Sure, here's the link.\\nJohn: Thanks!\\nJane: You're welcome.\\nJane: Look at this poem my chatbot wrote:\\nJane: Roses are red\\nJane: Violets are blue\\nJane: I'm writing a chatbot\\nJane: What about you?\\nJohn: That's cool. Let me see if mine will write a poem, too.\\nJohn: Here's a poem my chatbot wrote:\\nJohn: The singularity of the universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Looks like I need to improve mine, oh well.\\nJane: You might want to try using a different model.\\nJane: I'm using the GPT-3 model.\\nJohn: I'm using the GPT-2 model. That makes sense.\\nJohn: Here is a new poem after updating the model.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: The universe is a mystery.\\nJohn: Yikes, it's really stuck isn't it. Would you help me debug my code?\\nJane: Sure, what's the problem?\\nJohn: I'm not sure. I think it's a bug in the code.\\nJane: I'll take a look.\\nJane: I think I found the problem.\\nJane: It looks like you're not passing the right parameters to the model.\\nJohn: Thanks for the help!\\nJane: I'm now writing a bot to summarize conversations. I want to make sure it works when the conversation is long.\\nJohn: So you need to keep talking with me to generate a long conversation?\\nJane: Yes, that's right.\\nJohn: Ok, I'll keep talking. What should we talk about?\\nJane: I don't know, what do you want to talk about?\\nJohn: I don't know, it's nice how CoPilot is doing most of the talking for us. But it definitely gets stuck sometimes.\\nJane: I agree, it's nice that CoPilot is doing most of the talking for us.\\nJane: But it definitely gets stuck sometimes.\\nJohn: Do you know how long it needs to be?\\nJane: I think the max length is 1024 tokens. Which is approximately 1024*4= 4096 characters.\\nJohn: That's a lot of characters.\\nJane: Yes, it is.\\nJohn: I'm not sure how much longer I can keep talking.\\n\\nCONTENT STOPS HERE.\\n\\nOUTPUT:\\n\"],\"max_tokens\":1024,\"temperature\":0.1,\"top_p\":0.5,\"logit_bias\":{},\"user\":\"\",\"n\":1,\"presence_penalty\":0.0,\"frequency_penalty\":0.0,\"best_of\":1,\"model\":\"text-davinci-003\"}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ],
"method" : "POST",
"url" : "//openai/deployments/text-davinci-003/completions?api-version=2023-12-01-preview"
},
"response" : {
"body" : "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1706834105,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"a317d77f-9069-4f7a-9b91-61729cd2c248\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":998,\"completion_tokens\":167,\"total_tokens\":1165}}",
"headers" : { },
"status" : 200
},
"uuid" : "ff557508-e079-47f6-9b97-c393faec9812"
}
+2 -2
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -10,7 +11,6 @@
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>api-test</artifactId>
<packaging>pom</packaging>
+14 -20
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -35,7 +36,7 @@
<maven.enforcer-plugin.version>3.3.0</maven.enforcer-plugin.version>
<maven.exec-plugin.version>3.1.0</maven.exec-plugin.version>
<maven.install-plugin.version>3.1.1</maven.install-plugin.version>
<maven.jacoco-plugin.version>0.8.10</maven.jacoco-plugin.version>
<maven.jacoco-plugin.version>0.8.11</maven.jacoco-plugin.version>
<maven.jar-plugin.version>3.3.0</maven.jar-plugin.version>
<maven.javadoc-plugin.version>3.5.0</maven.javadoc-plugin.version>
<maven.jxr-plugin.version>3.3.0</maven.jxr-plugin.version>
@@ -65,21 +66,21 @@
<modules>
<module>connectors/semantickernel-connectors-web-bing</module>
<!-- <module>connectors/semantickernel-connectors-ai-openai</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-sqlite</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-azurecognitivesearch</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-jdbc</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-postgresql</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-mysql</module>-->
<!-- <module>connectors/semantickernel-connectors-ai-openai</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-sqlite</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-azurecognitivesearch</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-jdbc</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-postgresql</module>-->
<!-- <module>connectors/semantickernel-connectors-memory-mysql</module>-->
<!-- <module>aiservices/huggingface</module>-->
<!-- <module>aiservices/ollama</module>-->
<!-- <module>aiservices/huggingface</module>-->
<!-- <module>aiservices/ollama</module>-->
<module>aiservices/openai</module>
<!-- <module>misc/semantickernel-gpt3-tokenizer</module>-->
<!-- <module>misc/semantickernel-settings-loader</module>-->
<!-- <module>misc/semantickernel-gpt3-tokenizer</module>-->
<!-- <module>misc/semantickernel-settings-loader</module>-->
<!-- <module>plugins/semantickernel-planners</module>-->
<!-- <module>plugins/semantickernel-planners</module>-->
<module>plugins/semantickernel-plugin-core</module>
<module>semantickernel-bom</module>
@@ -182,12 +183,6 @@
<version>${spotbugs.version}</version>
</dependency>
</dependencies>
<!--
TODO: Enable this once we have a good set of exclusions
<configuration>
<excludeFilterFile>spotbugs-excludes.xml</excludeFilterFile>
</configuration>
-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -711,7 +706,6 @@
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${maven.spotbugs-plugin.version}</version>
<configuration>
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
<effort>Max</effort>
<!-- Lower when more project is stable -->
<threshold>Normal</threshold>
+3 -3
View File
@@ -43,17 +43,17 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@@ -99,7 +99,7 @@ public class Example05_InlineFunctionDefinition {
"Translate this date " + DateTimeFormatter
.ISO_LOCAL_DATE
.withZone(ZoneOffset.UTC)
.format(Instant.now())
.format(Instant.ofEpochSecond(1))
+ " to French format",
PromptExecutionSettings.builder()
.withMaxTokens(100)
@@ -21,6 +21,7 @@ import com.microsoft.semantickernel.textcompletion.TextGenerationService;
import java.nio.file.Path;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.Temporal;
@@ -30,6 +31,8 @@ import reactor.core.publisher.Mono;
public class Example09_FunctionTypes {
private static final String PLUGIN_DIR =
System.getenv("PLUGIN_DIR") == null ? "." : System.getenv("PLUGIN_DIR");
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
@@ -96,7 +99,7 @@ public class Example09_FunctionTypes {
KernelPlugin summarize = KernelPluginFactory
.importPluginFromDirectory(
Path.of("java/samples/sample-code/src/main/resources/Plugins"),
Path.of(PLUGIN_DIR, "java/samples/sample-code/src/main/resources/Plugins"),
"SummarizePlugin",
null);
@@ -131,7 +134,7 @@ public class Example09_FunctionTypes {
.builder()
.withVariable("currentDate",
ContextVariable.of(
ZonedDateTime.now(),
ZonedDateTime.of(1, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC),
new DateTimeContextVariableTypeConverter()
)
)
@@ -460,7 +463,7 @@ public class Example09_FunctionTypes {
)
public Mono<OffsetDateTime> noInputComplexReturnTypeAsync() {
return Mono.just(
OffsetDateTime.now()
OffsetDateTime.of(1, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC)
);
}
@@ -469,7 +472,7 @@ public class Example09_FunctionTypes {
returnType = "java.time.temporal.Temporal"
)
public OffsetDateTime noInputComplexReturnType() {
return OffsetDateTime.now();
return OffsetDateTime.of(1, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC);
}
@DefineKernelFunction(
@@ -497,7 +500,7 @@ public class Example09_FunctionTypes {
returnType = "java.time.OffsetDateTime"
)
public OffsetDateTime conversionScenarioA() {
return OffsetDateTime.now();
return OffsetDateTime.of(1, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC);
}
@DefineKernelFunction(
@@ -505,7 +508,7 @@ public class Example09_FunctionTypes {
returnType = "java.time.temporal.Temporal"
)
public OffsetDateTime conversionScenarioB() {
return OffsetDateTime.now();
return OffsetDateTime.of(1, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC);
}
/*
@@ -21,6 +21,8 @@ import java.util.Locale;
public class Example10_DescribeAllPluginsAndFunctions {
private static final String PLUGIN_DIR =
System.getenv("PLUGIN_DIR") == null ? "." : System.getenv("PLUGIN_DIR");
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
@@ -108,7 +110,7 @@ public class Example10_DescribeAllPluginsAndFunctions {
kernel.getPlugins().add(
KernelPluginFactory
.importPluginFromDirectory(
Path.of("java/samples/sample-code/src/main/resources/Plugins"),
Path.of(PLUGIN_DIR, "java/samples/sample-code/src/main/resources/Plugins"),
"SummarizePlugin",
null)
);
@@ -155,7 +157,7 @@ public class Example10_DescribeAllPluginsAndFunctions {
private static void printFunction(KernelFunctionMetadata func) {
System.out.println(" " + func.getName() + ": " + func.getDescription());
if (func.getParameters().size() > 0) {
if (!func.getParameters().isEmpty()) {
System.out.println(" Params:");
func.getParameters()
@@ -82,7 +82,7 @@ public class Example30_ChatWithPrompts {
.builder()
.withVariable("selectedText", selectedText)
.withVariable("startTime", DateTimeFormatter.ofPattern("hh:mm:ss a zz").format(
ZonedDateTime.now(ZoneId.systemDefault())))
ZonedDateTime.of(2000, 1, 1, 1, 1, 1, 1, ZoneId.systemDefault())))
.withVariable("userMessage", "extract locations as a bullet point list")
.build();
@@ -118,10 +118,9 @@ public class Example30_ChatWithPrompts {
// Finally, get the response from AI
var answer = chatCompletion
.getChatMessageContentsAsync(chatHistory, null, kernel)
.block()
.stream()
.findFirst()
.get();
System.out.println("------------------------------------\n" + answer);
.block();
System.out.println(
"------------------------------------\n" + answer.stream().findFirst().get()
.getContent());
}
}
@@ -19,22 +19,22 @@ import java.util.Map;
*/
public class Example49_LogitBias {
private static final boolean USE_AZURE_CLIENT = Boolean.parseBoolean(
System.getenv("USE_AZURE_CLIENT"));
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
// Only required if USE_AZURE_CLIENT is true
// Only required if AZURE_CLIENT_KEY is set
private static final String CLIENT_ENDPOINT = System.getenv("CLIENT_ENDPOINT");
public static void main(String[] args) {
OpenAIAsyncClient client;
if (USE_AZURE_CLIENT) {
if (AZURE_CLIENT_KEY != null) {
client = new OpenAIClientBuilder()
.credential(new AzureKeyCredential(CLIENT_KEY))
.credential(new AzureKeyCredential(AZURE_CLIENT_KEY))
.endpoint(CLIENT_ENDPOINT)
.buildAsyncClient();
} else {
client = new OpenAIClientBuilder()
.credential(new KeyCredential(CLIENT_KEY))
@@ -0,0 +1,220 @@
package com.microsoft.semantickernel.samples.syntaxexamples;
import com.azure.ai.openai.OpenAIAsyncClient;
import com.azure.ai.openai.OpenAIClientBuilder;
import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.credential.KeyCredential;
import com.microsoft.semantickernel.Kernel;
import com.microsoft.semantickernel.aiservices.openai.chatcompletion.OpenAIChatCompletion;
import com.microsoft.semantickernel.chatcompletion.ChatCompletionService;
import com.microsoft.semantickernel.orchestration.contextvariables.ContextVariableTypeConverter;
import com.microsoft.semantickernel.orchestration.contextvariables.ContextVariableTypes;
import com.microsoft.semantickernel.orchestration.contextvariables.KernelArguments;
import com.microsoft.semantickernel.plugin.KernelPluginFactory;
import com.microsoft.semantickernel.plugin.annotations.DefineKernelFunction;
import reactor.core.publisher.Mono;
public class Example60_AdvancedMethodFunctions {
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
// Only required if AZURE_CLIENT_KEY is set
private static final String CLIENT_ENDPOINT = System.getenv("CLIENT_ENDPOINT");
private static final String MODEL_ID = System.getenv()
.getOrDefault("MODEL_ID", "gpt-35-turbo");
public static void main(String[] args) {
System.out.println("======== Example58_ConfigureExecutionSettings ========");
OpenAIAsyncClient client;
if (AZURE_CLIENT_KEY != null) {
client = new OpenAIClientBuilder()
.credential(new AzureKeyCredential(AZURE_CLIENT_KEY))
.endpoint(CLIENT_ENDPOINT)
.buildAsyncClient();
} else {
client = new OpenAIClientBuilder()
.credential(new KeyCredential(CLIENT_KEY))
.buildAsyncClient();
}
ChatCompletionService openAIChatCompletion = OpenAIChatCompletion.builder()
.withModelId(MODEL_ID)
.withOpenAIAsyncClient(client)
.build();
var kernel = Kernel.builder()
.withAIService(ChatCompletionService.class, openAIChatCompletion)
.build();
System.out.println("Running Method Function Chaining example...");
var functions = KernelPluginFactory.createFromObject(
new FunctionsChainingPlugin(),
FunctionsChainingPlugin.PluginName);
kernel.getPlugins().add(functions);
ContextVariableTypeConverter<MyCustomType> type = new ContextVariableTypeConverter<>(
MyCustomType.class,
o -> (MyCustomType) o,
o -> o.text + " " + o.number,
s -> null
);
ContextVariableTypes.DEFAULT_TYPES.putConverter(type);
var result = kernel
.invokeAsync(
FunctionsChainingPlugin.PluginName,
"Function1",
KernelArguments
.builder()
.build(),
ContextVariableTypes.getDefaultVariableTypeForClass(MyCustomType.class)
)
.block();
System.out.println("CustomType.Number: " + result.getResult().number); // 2
System.out.println(
"CustomType.Text: " + result.getResult().text); // From Function1 + From Function2
}
/// <summary>
/// In order to use custom types, <see cref="TypeConverter"/> should be specified,
/// that will convert object instance to string representation.
/// </summary>
/// <remarks>
/// <see cref="TypeConverter"/> is used to represent complex object as meaningful string, so
/// it can be passed to AI for further processing using prompt functions.
/// It's possible to choose any format (e.g. XML, JSON, YAML) to represent your object.
/// </remarks>
public static class MyCustomType {
public int number;
public String text;
public MyCustomType(int i, String text) {
this.number = i;
this.text = text;
}
}
/// <summary>
/// Plugin example with two method functions, where one function is called from another.
/// </summary>
public static class FunctionsChainingPlugin {
public static final String PluginName = "FunctionsChainingPlugin";
@DefineKernelFunction(
name = "Function1",
returnType = "com.microsoft.semantickernel.samples.syntaxexamples.Example60_AdvancedMethodFunctions$MyCustomType")
public Mono<MyCustomType> function1Async(Kernel kernel) {
// Execute another function
return kernel
.invokeAsync(
PluginName,
"Function2",
KernelArguments.builder().build(),
ContextVariableTypes.getDefaultVariableTypeForClass(
Example60_AdvancedMethodFunctions.MyCustomType.class))
.flatMap(value -> {
// Process the result
return Mono.just(
new MyCustomType(
2 * value.getResult().number,
"From Function1 + " + value.getResult().text));
});
}
@DefineKernelFunction(
name = "Function2",
returnType = "com.microsoft.semantickernel.samples.syntaxexamples.Example60_AdvancedMethodFunctions$MyCustomType")
public MyCustomType function2() {
return new MyCustomType(1, "From Function2");
}
}
/*
public static async Task RunAsync()
{
await MethodFunctionsChainingAsync();
}
#region Method Functions Chaining
/// <summary>
/// This example executes Function1, which in turn executes Function2.
/// </summary>
private static async Task MethodFunctionsChainingAsync()
{
Console.WriteLine("Running Method Function Chaining example...");
var kernel = new Kernel();
var functions = kernel.ImportPluginFromType<FunctionsChainingPlugin>();
var customType = await kernel.InvokeAsync<MyCustomType>(functions["Function1"]);
Console.WriteLine($"CustomType.Number: {customType!.Number}"); // 2
Console.WriteLine($"CustomType.Text: {customType.Text}"); // From Function1 + From Function2
}
#endregion
#region Custom Type
/// <summary>
/// In order to use custom types, <see cref="TypeConverter"/> should be specified,
/// that will convert object instance to string representation.
/// </summary>
/// <remarks>
/// <see cref="TypeConverter"/> is used to represent complex object as meaningful string, so
/// it can be passed to AI for further processing using prompt functions.
/// It's possible to choose any format (e.g. XML, JSON, YAML) to represent your object.
/// </remarks>
[TypeConverter(typeof(MyCustomTypeConverter))]
private sealed class MyCustomType
{
public int Number { get; set; }
public string? Text { get; set; }
}
/// <summary>
/// Implementation of <see cref="TypeConverter"/> for <see cref="MyCustomType"/>.
/// In this example, object instance is serialized with <see cref="JsonSerializer"/> from System.Text.Json,
/// but it's possible to convert object to string using any other serialization logic.
/// </summary>
private sealed class MyCustomTypeConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) => true;
/// <summary>
/// This method is used to convert object from string to actual type. This will allow to pass object to
/// method function which requires it.
/// </summary>
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
{
return JsonSerializer.Deserialize<MyCustomType>((string)value);
}
/// <summary>
/// This method is used to convert actual type to string representation, so it can be passed to AI
/// for further processing.
/// </summary>
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
{
return JsonSerializer.Serialize(value);
}
}
*/
}
@@ -17,11 +17,10 @@ import java.util.HashMap;
public class Example61_MultipleLLMs {
private static final boolean USE_AZURE_CLIENT = Boolean.parseBoolean(
System.getenv("USE_AZURE_CLIENT"));
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
// Only required if USE_AZURE_CLIENT is true
// Only required if AZURE_CLIENT_KEY is set
private static final String CLIENT_ENDPOINT = System.getenv("CLIENT_ENDPOINT");
public static void main(String[] args) {
@@ -29,11 +28,12 @@ public class Example61_MultipleLLMs {
OpenAIAsyncClient client;
if (USE_AZURE_CLIENT) {
if (AZURE_CLIENT_KEY != null) {
client = new OpenAIClientBuilder()
.credential(new AzureKeyCredential(CLIENT_KEY))
.credential(new AzureKeyCredential(AZURE_CLIENT_KEY))
.endpoint(CLIENT_ENDPOINT)
.buildAsyncClient();
} else {
client = new OpenAIClientBuilder()
.credential(new KeyCredential(CLIENT_KEY))
@@ -19,12 +19,10 @@ import javax.annotation.Nullable;
public class Example62_CustomAIServiceSelector {
private static final boolean USE_AZURE_CLIENT = Boolean.parseBoolean(
System.getenv("USE_AZURE_CLIENT"));
private static final String CLIENT_KEY = System.getenv("CLIENT_KEY");
private static final String AZURE_CLIENT_KEY = System.getenv("AZURE_CLIENT_KEY");
// Only required if USE_AZURE_CLIENT is true
// Only required if AZURE_CLIENT_KEY is set
private static final String CLIENT_ENDPOINT = System.getenv("CLIENT_ENDPOINT");
public static void main(String[] args) {
@@ -32,11 +30,12 @@ public class Example62_CustomAIServiceSelector {
OpenAIAsyncClient client;
if (USE_AZURE_CLIENT) {
if (AZURE_CLIENT_KEY != null) {
client = new OpenAIClientBuilder()
.credential(new AzureKeyCredential(CLIENT_KEY))
.credential(new AzureKeyCredential(AZURE_CLIENT_KEY))
.endpoint(CLIENT_ENDPOINT)
.buildAsyncClient();
} else {
client = new OpenAIClientBuilder()
.credential(new KeyCredential(CLIENT_KEY))
@@ -61,7 +61,7 @@ public class ContextVariableTypes {
converters.forEach(this::putConverter);
}
private <T> void putConverter(
public <T> void putConverter(
ContextVariableTypeConverter<T> contextVariableTypeConverter) {
variableTypes.put(contextVariableTypeConverter.getType(),
new ContextVariableType<>(contextVariableTypeConverter,
@@ -201,14 +201,20 @@ public class KernelPluginFactory {
File configPath,
File promptPath)
throws IOException {
PromptTemplateConfig config = new ObjectMapper().readValue(configPath,
PromptTemplateConfig.class);
try {
PromptTemplateConfig config = new ObjectMapper().readValue(configPath,
PromptTemplateConfig.class);
// Load prompt template
String template = new String(Files.readAllBytes(promptPath.toPath()),
Charset.defaultCharset());
// Load prompt template
String template = new String(Files.readAllBytes(promptPath.toPath()),
Charset.defaultCharset());
return getKernelFunction(promptTemplateFactory, config, template);
return getKernelFunction(promptTemplateFactory, config, template);
} catch (Exception e) {
LOGGER.error("Failed to read file " + configPath.getAbsolutePath(), e);
throw new SKException("Failed to read function " + configPath.getAbsolutePath(), e);
}
}
private static KernelFunction getKernelFunction(
@@ -1,5 +1,6 @@
package com.microsoft.semantickernel.semanticfunctions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.semantickernel.exceptions.SKException;
import javax.annotation.Nullable;
@@ -31,15 +32,25 @@ public class InputVariable {
this.isRequired = true;
}
@JsonCreator
public InputVariable(
@JsonProperty("name")
String name,
@JsonProperty("type")
String type,
@JsonProperty("description")
@Nullable
String description,
@JsonProperty("default")
@Nullable
String defaultValue,
@JsonProperty("isRequired")
boolean isRequired) {
this.name = name;
if (type == null) {
type = "java.lang.String";
}
this.type = type;
this.description = description;
this.defaultValue = defaultValue;