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

Commits on Apr 29, 2024

  1. fix(core): update prompts (#6738)

    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.
    pengx17 committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    7c5a259 View commit details
    Browse the repository at this point in the history