Skip to content

Commit

Permalink
feat: enhance chat prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ameddin73 committed Mar 11, 2023
1 parent 3abf0dc commit b88a891
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ export class ApiClient {
const response = await this.client.createChatCompletion({
model: CHAT_MODEL,
messages: [
{ 'role': 'system', 'content': `You only respond with terminal commands for ${platform} systems. Just respond with executable code, no explanation.` },
{ 'role': 'user', 'content': `CLI command for this: check if google.com can be reached` },
{ 'role': 'assistant', 'content': `ping www.google.com` },
{ 'role': 'user', 'content': `good. CLI command for this: list all the aks cluster names` },
{ 'role': 'assistant', 'content': "You can use the following command to list all the AKS clusters in your subscription:```az aks list --output table--query '[].name'``` This will display a table format output with only the AKS cluster names." },
{ 'role': 'user', 'content': 'no. only include code, no explanation.' },
{
'role': 'system', 'content': `You only respond with terminal commands for ${platform} systems. Just respond with executable code, no explanation.
Avoid using subshells.` },
{ 'role': 'user', 'content': 'CLI command for this: check if google.com can be reached' },
{ 'role': 'assistant', 'content': 'ping www.google.com' },
{ 'role': 'user', 'content': 'good. CLI command for this: list all the aks cluster names' },
{ 'role': 'assistant', 'content': `az aks list--query '[].name'` },
{ 'role': 'user', 'content': 'good. CLI command for this: kill process using port 8080' },
{ 'role': 'assistant', 'content': 'sudo lsof -t -i :8080 | xargs kill' },
{ 'role': 'user', 'content': 'good.' },
{ 'role': 'user', 'content': `CLI command for this: ${prompt}. Include no explanation or natural language. Just code. Do not include templated variables.` },
],
Expand Down

0 comments on commit b88a891

Please sign in to comment.