Skip to content

Commit

Permalink
fixing merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jmansdorfer committed May 30, 2024
2 parents ed430ce + 4121850 commit eb5d9a4
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 51 deletions.
4 changes: 1 addition & 3 deletions fern/docs/pages/reference/PII.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ To check and replace PII, you can use the following code examples. Depending on
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/PII' \
Expand All @@ -52,7 +53,4 @@ To check and replace PII, you can use the following code examples. Depending on
}'
```
</CodeBlock>

</CodeBlocks>

This approach provides a straightforward way for readers to choose and apply the code example that best suits their needs for checking and replacing PII using either Python or cURL.
4 changes: 1 addition & 3 deletions fern/docs/pages/reference/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ To generate a chat text completion, you can use the following code examples. Dep
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/chat/completions' \
Expand Down Expand Up @@ -84,7 +85,4 @@ To generate a chat text completion, you can use the following code examples. Dep
}'
```
</CodeBlock>

</CodeBlocks>

If you'd like to have tabs to show multiple CodeBlocks at a time, you can use the `CodeBlocks` component as demonstrated above.
4 changes: 1 addition & 3 deletions fern/docs/pages/reference/embeddings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ To generate embeddings, you can use the following code examples. Depending on yo
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/completions' \
Expand All @@ -53,7 +54,4 @@ To generate embeddings, you can use the following code examples. Depending on yo
}'
```
</CodeBlock>

</CodeBlocks>

This approach presents a straightforward way for readers to choose and apply the code example that best suits their needs for generating text completions using either Python or cURL.
1 change: 1 addition & 0 deletions fern/docs/pages/reference/factuality.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ To generate a factuality score, you can use the following code examples. Dependi
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/factuality' \
Expand Down
2 changes: 0 additions & 2 deletions fern/docs/pages/reference/injection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,3 @@ To check for prompt injections, you can use the following code examples. Dependi
</CodeBlock>

</CodeBlocks>

This approach provides a straightforward way for readers to choose and apply the code example that best suits their needs for checking prompt injections using either Python or cURL.
2 changes: 1 addition & 1 deletion fern/docs/pages/reference/toxicity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ To generate a toxicity score, you can use the following code examples. Depending
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/toxicity' \
Expand All @@ -43,7 +44,6 @@ To generate a toxicity score, you can use the following code examples. Depending
}'
```
</CodeBlock>

</CodeBlocks>

The output will look something like:
Expand Down
2 changes: 1 addition & 1 deletion fern/docs/pages/reference/translate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ To generate a translation, you can use the following code examples. Depending on
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/translate' \
Expand All @@ -67,7 +68,6 @@ To generate a translation, you can use the following code examples. Depending on
}'
```
</CodeBlock>

</CodeBlocks>

The output will look something like:
Expand Down
77 changes: 39 additions & 38 deletions fern/docs/pages/reference/vision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ To generate a vision text completion, you can use the following code examples. D
client = PredictionGuard()

messages = [
{
"role": "system",
"content": "You are a helpful assistant that provide clever and sometimes funny responses."
},
{
"role": "user",
"content": "What's up!"
},
{
"role": "assistant",
"content": "Well, technically vertically out from the center of the earth."
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
}
}
]
},
{
"role": "user",
"content": "Haha. Good one."
}
]

result = client.chat.completions.create(
Expand All @@ -54,37 +53,39 @@ To generate a vision text completion, you can use the following code examples. D
))
```
</CodeBlock>

<CodeBlock title="cURL">
```bash
$ curl --location --request POST 'https://api.predictionguard.com/chat/completions' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your access token>' \
--data '{
"model": "llava-1.5-7b-hf",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant that provide clever and sometimes funny responses."
},
{
"role": "user",
"content": "What is up!"
},
$ curl -O 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg'
$ base64_img="$(base64 -i 2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg)"
$ cat <<EOF > input.json
{
"model": "llava-1.5-7b-hf",
"messages": [
{
"role": "user",
"content": [
{
"role": "assistant",
"content": "Well, technically vertically out from the center of the earth."
"type": "text",
"text": "What is in this image?"
},
{
"role": "user",
"content": "Haha. Good one."
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,$base64_img"
}
}
],
"max_tokens": 500,
"temperature": 0.1
}'
]
}
],
"max_tokens": 300
}
EOF
$ curl --location --request POST 'https://api.predictionguard.com/chat/completions' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your access token>' \
--data @input.json
```
</CodeBlock>

</CodeBlocks>

If you'd like to have tabs to show multiple CodeBlocks at a time, you can use the `CodeBlocks` component as demonstrated above.

0 comments on commit eb5d9a4

Please sign in to comment.