Unverified Commit 69795d2d authored by Matt Williams's avatar Matt Williams Committed by GitHub
Browse files

Update examples/python-json-datagenerator/readme.md


Co-authored-by: default avatarBruce MacDonald <brucewmacdonald@gmail.com>
parent acde0819
...@@ -9,7 +9,7 @@ There are two python scripts in this example. `randomaddresses.py` generates ran ...@@ -9,7 +9,7 @@ There are two python scripts in this example. `randomaddresses.py` generates ran
Both programs are basically the same, with a different prompt for each, demonstrating two different ideas. The key part of getting JSON out of a model is to state in the prompt or system prompt that it should respond using JSON, and specifying the `format` as `json` in the data body. Both programs are basically the same, with a different prompt for each, demonstrating two different ideas. The key part of getting JSON out of a model is to state in the prompt or system prompt that it should respond using JSON, and specifying the `format` as `json` in the data body.
```python ```python
prompt = f"generate one realisticly believable sample data set of a persons first name, last name, address in {country}, and phone number. Do not use common names. Respond using JSON. Key names should with no backslashes, values should use plain ascii with no special characters." prompt = f"generate one realistically believable sample data set of a persons first name, last name, address in {country}, and phone number. Do not use common names. Respond using JSON. Key names should with no backslashes, values should use plain ascii with no special characters."
data = { data = {
"prompt": prompt, "prompt": prompt,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment