-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
how to change raw prompt to my custom prompt #963
Comments
Hey @xmxxiong , what is the current client that you're using at the moment? |
ollama,model is qwen2 |
maybe the raw prompt should be stored in a unified warehouse for easy customization |
Based on the information provided, I understand you're trying to customize the system prompt for a chat completion API call, specifically to generate synthetic user data. The issue you're facing is that an additional instruction is being appended to your desired system prompt. To solve this, we need to modify the code to ensure that only the custom system prompt is used, without any additional instructions being appended. Here's how we can achieve this: 1. First, let's define the custom system prompt:
2. Then, we need to format this prompt with the actual JSON schema:
3. Use this formatted prompt in the chat completion call:
This approach should prevent any additional instructions from being appended to your system prompt. The key is to format the custom_system_prompt with the actual JSON schema before passing it to the chat completion call. I tested this out with Groq. You can change it to your current client:
Output:
|
Is your feature request related to a problem? Please describe.
yes i want set system prompt to replace raw prompt
Describe the solution you'd like
just like:
messages=[
{
"role": "system",
"content": "you are a xxxx, you need xxxx, and provide the parsed objects in json that match the following json_schema{json_schema}",
},
{"role": "user", "content": f"Generate a {5} synthetic users"},
],
bug now i get :
you are a xxxx, you need xxxx, and provide the parsed objects in json that match the following json_schema{json_schema} As a genius expert, your task is to understand the content and provide the parsed objects in json that match the following json_schema:xxxx,
what i want get is:
you are a xxxx, you need xxxx, and provide the parsed objects in json that match the following json_schema{json_schema}
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: