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

fixing blocked image #45

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fern/docs/pages/reference/chat_vision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ images that are base64 encoded represented by a data uri.
{
"type": "image_url",
"image_url": {
"url": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"url": "https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg",
}
}
]
Expand Down Expand Up @@ -97,7 +97,7 @@ images that are base64 encoded represented by a data uri.
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

image, err := client.NewImageNetwork("https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png")
image, err := client.NewImageNetwork("https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg")
if err != nil {
return fmt.Errorf("ERROR: %w", err)
}
Expand Down Expand Up @@ -167,7 +167,7 @@ images that are base64 encoded represented by a data uri.
const client = new pg.Client('https://api.predictionguard.com', process.env.PREDICTIONGUARD_API_KEY);

async function ChatVision() {
const image = new pg.ImageNetwork('https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png');
const image = new pg.ImageNetwork('https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg');

const input = {
role: pg.Roles.User,
Expand All @@ -194,7 +194,7 @@ images that are base64 encoded represented by a data uri.

<CodeBlock title="cURL">
```bash
curl -O 'https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png'
curl -O 'https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg'

base64_img="$(base64 -i GKLN4qPXEAArqoK.png)"

Expand Down
6 changes: 3 additions & 3 deletions fern/docs/pages/usingllms/chat_vision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ messages = [
{
"type": "image_url",
"image_url": {
"url": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"url": "https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg",
}
}
]
Expand Down Expand Up @@ -68,7 +68,7 @@ messages = [
{
"type": "image_url",
"image_url": {
"url": "GKLN4qPXEAArqoK.png",
"url": "3497460990_11dfb95dd1_z.jpg",
}
}
]
Expand Down Expand Up @@ -104,7 +104,7 @@ def encode_image_to_base64(image_path):
base64_message = base64_encoded_data.decode('utf-8')
return base64_message

image_path = 'GKLN4qPXEAArqoK.png'
image_path = '3497460990_11dfb95dd1_z.jpg'
encoded_image = encode_image_to_base64(image_path)

```
Expand Down
Loading