Is system prompt/user roles supported when using openai api?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am wondering is system prompt / in-context learning supported when using openai api?
For example, will the following example work as expected? Thanks!
```python
import openai
openai.api_key = "EMPTY"
openai.api_base = "http://localhost:8000/v1"
model = "vicuna-7b-v1.3"
completion = openai.ChatCompletion.create(
model=model,
messages=[
{"role": "system", "content": "You are a helpful assistant. Please repeat after me."},
{"role": "user", "content": "Hello!"},
{"role": "assistant", "content": "Hello!"},
{"role": "user", "content": "Hi!"}
]
)
print(completion.choices[0].message)
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides a Python openai.ChatCompletion.create example with system, user, and assistant messages. Begin at the OpenAI-compatible ChatCompletion API entry point and verify whether these roles are accepted and preserved; done means a documented answer or a focused test showing the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100