Skip to content

Commit

Permalink
quality of life gpt updates
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed May 2, 2024
1 parent 507bce2 commit 9a72d6f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/main/java/org/myrobotlab/service/Gpt3.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.myrobotlab.logging.LoggingFactory;
import org.myrobotlab.programab.Response;
import org.myrobotlab.service.config.Gpt3Config;
import org.myrobotlab.service.config.HttpClientConfig;
import org.myrobotlab.service.data.Utterance;
import org.myrobotlab.service.interfaces.ResponsePublisher;
import org.myrobotlab.service.interfaces.TextListener;
Expand Down Expand Up @@ -103,13 +104,7 @@ public Response getResponse(String text) {
+ temp
+ " }";

// completions
// String json =
// "{\r\n" + " \"model\": \"" + c.engine + "\",\r\n" + " \"prompt\": \"" + text + "\",\r\n" + " \"temperature\": " + c.temperature + ",\r\n" + " \"max_tokens\": "
// + c.maxTokens + ",\r\n" + " \"top_p\": 1,\r\n" + " \"frequency_penalty\": 0,\r\n" + " \"presence_penalty\": 0\r\n" + "}";


HttpClient http = (HttpClient) startPeer("http");
HttpClient<HttpClientConfig> http = (HttpClient) startPeer("http");

log.info("curl {} -d '{}'", c.url, json);

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/resource/WebGui/app/service/js/Gpt3Gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ angular.module('mrlapp.service.Gpt3Gui', []).controller('Gpt3GuiCtrl', ['$scope'
}
}

$scope.saveValues = function(){
msg.send("apply", $scope.service.config)
msg.send("save")
}

msg.subscribe('publishRequest')
msg.subscribe('publishUtterance')
msg.subscribe(this)
Expand Down
31 changes: 29 additions & 2 deletions src/main/resources/resource/WebGui/app/service/views/Gpt3Gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,34 @@
</div>
<div class="row">
<img ng-show="service.config.token" src="/connected.png"/>
<img ng-show="!service.config.token" src="/disconnected.png"/>
<img ng-show="!service.config.token" src="/disconnected.png"/>
</div>
<div class="row">
&nbsp;
</div>
<div class="row">
<table class="table table-striped table-hover">
<tr>
<td>url</td><td><input class="form-control" ng-model="service.config.url" /></td>
</tr>
<tr>
<td>model</td><td><input class="form-control" ng-model="service.config.engine" /></td>
</tr>
<tr>
<td>temperature</td><td><input class="form-control" ng-model="service.config.temperature" /></td>
</tr>
<tr>
<td>prefix</td><td><textarea rows="7" class="form-control" ng-model="service.config.prefix"></textarea></td>
</tr>
<tr>
<td>token</td><td><input type="password" class="form-control" ng-model="service.config.token" /></td>
</tr>
<tr>
<td>
<button class="btn btn-default" ng-click="saveValues()">save</button>
</td>
</tr>
</table>
</div>
<div class="row">
<form class="form-inline">
Expand All @@ -34,7 +61,7 @@
</div>

<div class="row">
<table class="table table-hover">
<table class="table table-striped table-hover">
<tbody>
<tr ng-repeat="e in utterances" >
<td>
Expand Down

0 comments on commit 9a72d6f

Please sign in to comment.