Skip to content

Commit

Permalink
Turn off augmentation looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina Gum committed Mar 18, 2024
1 parent 6505f18 commit 69c892a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
23 changes: 14 additions & 9 deletions js/packages/teams-ai/src/models/LlamaModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,26 @@ export class LlamaModel implements PromptCompletionModel {
if (last.role !== 'user') {
last = undefined;
}
// TODO: try catch
// TODO: make real interface
const res = await this._httpClient.post<{ output: string }>(this.options.endpoint, {
input_data: {
input_string: result.output,
parameters: template.config.completion
}
});
let res;

try {
res = await this._httpClient.post<{ output: string }>(this.options.endpoint, {
input_data: {
input_string: result.output,
parameters: template.config.completion
}
});
} catch (err) {
console.error(err);
throw err;
}

return {
status: 'success',
input: last,
message: {
role: 'assistant',
content: res.data.output
content: res!.data.output
}
};
}
Expand Down
3 changes: 2 additions & 1 deletion js/samples/04.ai.g.LLAMA/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ const storage = new MemoryStorage();
const app = new Application<ApplicationTurnState>({
storage,
ai: {
planner
planner,
allow_looping: false
}
});

Expand Down

0 comments on commit 69c892a

Please sign in to comment.