Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): update prompts #6738

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

pengx17
Copy link
Collaborator

@pengx17 pengx17 commented Apr 29, 2024

Update prompts:

When sending a message to openai, we actually send two messages.
There are two issues here:

  1. the role in the first message shall be user or system
  2. the content in the first message is not being interpolated at all.
[
  {
    role: "assistant",
    createdAt: "2024-04-27T06:30:34.820Z",
    params: {
      language: "French",
    },
    content: "You are a translation expert, please translate the following content into French, and only perform the translation action, keeping the translated content in the same format as the original content:\n\n          \"\"\"\"\n\n          \n\n          \"\"\"\"",
  },
  {
    role: "user",
    content: "Basic things you should know:",
    attachments: undefined,
    params: {
      language: "French",
    },
    createdAt: "2024-04-29T09:42:11.466Z",
  },
]

In this PR I removed content from prompts and let open ai use the second message (user) as the input.

Copy link

graphite-app bot commented Apr 29, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

@pengx17 pengx17 marked this pull request as ready for review April 29, 2024 10:37
Copy link
Collaborator Author

pengx17 commented Apr 29, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @pengx17 and the rest of your teammates on Graphite Graphite

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.79%. Comparing base (1d3c477) to head (7c5a259).

Additional details and impacted files
@@           Coverage Diff           @@
##           canary    #6738   +/-   ##
=======================================
  Coverage   64.79%   64.79%           
=======================================
  Files         581      581           
  Lines       27188    27188           
  Branches     2427     2427           
=======================================
  Hits        17617    17617           
  Misses       9306     9306           
  Partials      265      265           
Flag Coverage Δ
server-test 74.54% <ø> (ø)
unittest 40.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pengx17 pengx17 requested review from darkskygit and EYHN April 29, 2024 10:50
Copy link

graphite-app bot commented Apr 29, 2024

Merge activity

Update prompts:

When sending a message to openai, we actually send two messages.
There are two issues here:

1. the role in the first message shall be user or system
2. the content in the first message is not being interpolated at all.

```
[
  {
    role: "assistant",
    createdAt: "2024-04-27T06:30:34.820Z",
    params: {
      language: "French",
    },
    content: "You are a translation expert, please translate the following content into French, and only perform the translation action, keeping the translated content in the same format as the original content:\n\n          \"\"\"\"\n\n          \n\n          \"\"\"\"",
  },
  {
    role: "user",
    content: "Basic things you should know:",
    attachments: undefined,
    params: {
      language: "French",
    },
    createdAt: "2024-04-29T09:42:11.466Z",
  },
]
```

In this PR I removed `content` from prompts and let open ai use the second message (user) as the input.
@EYHN EYHN force-pushed the xp/04-29-fix_core_update_prompts branch from e86d107 to 7c5a259 Compare April 29, 2024 11:02
@graphite-app graphite-app bot merged commit 7c5a259 into canary Apr 29, 2024
32 checks passed
@graphite-app graphite-app bot deleted the xp/04-29-fix_core_update_prompts branch April 29, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants