Skip to content

Commit

Permalink
Merge pull request #84 from UN-OCHA/develop
Browse files Browse the repository at this point in the history
v1.5.1
  • Loading branch information
orakili authored Aug 27, 2024
2 parents 42ed56d + d7d524e commit 02bf7a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/ocha_ai_chat/components/chat-form/chat-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ button doesn't overlay any text */
* Instead of introducing a CD dependency, we add a few status message styles.
*/
.ocha-ai-chat-result-feedback .messages {
margin-block-start: 0.5rem;
margin: 0.5rem 0 0 0;
padding: 0.5rem;
border: 1px solid var(--cd-grey--mid);
border-radius: 3px;
Expand Down Expand Up @@ -570,6 +570,8 @@ button doesn't overlay any text */
/* Drupal message. */
.ocha-ai-chat-popup .ocha-ai-chat-chat-form-wrapper .messages-list {
z-index: 10;
overflow-y: auto;
max-height: 30%;
padding: 0.5rem 0.5rem 0.5rem 1rem;
background: white;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/ocha_ai/Completion/AwsBedrock.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function answer(string $question, string $context): string {
* Request body.
*/
protected function generateRequestBody(string $prompt): array {
$max_tokens = $this->getPluginSetting('max_tokens', 512);
$max_tokens = (int) $this->getPluginSetting('max_tokens', 512);

switch ($this->getPluginSetting('model')) {
case 'amazon.titan-text-express-v1':
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/ocha_ai/Completion/AzureOpenAi.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function answer(string $question, string $context): string {
'messages' => $messages,
'temperature' => 0.0,
'top_p' => 0.9,
'max_tokens' => $this->getPluginSetting('max_tokens', 512),
'max_tokens' => (int) $this->getPluginSetting('max_tokens', 512),
];

try {
Expand Down

0 comments on commit 02bf7a6

Please sign in to comment.