From 8367e64553a7c0838034ddcaece78f3493849b2b Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Fri, 9 Aug 2024 14:46:39 -0400 Subject: [PATCH 1/2] updating example images to stock images. --- fern/docs/pages/reference/chat_vision.mdx | 14 +++++++------- fern/docs/pages/usingllms/chat_vision.mdx | 12 ++++++------ ...on-Guard-Prediction-Guard-API-1.0-resolved.yaml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fern/docs/pages/reference/chat_vision.mdx b/fern/docs/pages/reference/chat_vision.mdx index 823eccf..809dafa 100644 --- a/fern/docs/pages/reference/chat_vision.mdx +++ b/fern/docs/pages/reference/chat_vision.mdx @@ -39,7 +39,7 @@ images that are base64 encoded represented by a data uri. { "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", + "url": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", } } ] @@ -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://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg") + image, err := client.NewImageNetwork("https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png") if err != nil { return fmt.Errorf("ERROR: %w", err) } @@ -165,7 +165,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://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg'); + const image = new pg.ImageNetwork('https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png'); const input = { role: pg.Roles.User, @@ -192,7 +192,7 @@ images that are base64 encoded represented by a data uri. ```bash - 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' + curl -O 'https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png' base64_img="$(base64 -i 2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg)" @@ -232,16 +232,16 @@ The output will look something like: ```json { - "id":"chat-xQNsuexunK7zeMjlW25g99hax9qo4", + "id":"chat-zstjj2MKpRdKfBmCMILK9wgx7I09N", "object":"chat_completion", - "created":1717784541, + "created":1723228682, "model":"llava-1.5-7b-hf", "choices":[ { "index":0, "message":{ "role":"assistant", - "content":"The image features a peaceful scene of a wooden pathway traveling through an open grassy field. The pathway seems to be leading to an even more remote and expansive meadow, providing a serene and picturesque view. The surroundings consist of lush green grass and trees, creating a sense of tranquility in the landscape.", + "content":"In the image, there is a person standing on the back of a vehicle in a city. The vehicle is situated next to a taxi on the street. Another car can be seen approaching, and there is also a traffic light visible in the scene. The person standing on the vehicle could be a man drying his clothes, creating a unique and eye-catching sight. Additionally, a handbag is present near the person riding on the vehicle, likely belonging to them.", "output":null }, "status":"success" diff --git a/fern/docs/pages/usingllms/chat_vision.mdx b/fern/docs/pages/usingllms/chat_vision.mdx index 52adb0a..60e11d5 100644 --- a/fern/docs/pages/usingllms/chat_vision.mdx +++ b/fern/docs/pages/usingllms/chat_vision.mdx @@ -23,7 +23,7 @@ messages = [ { "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", + "url": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", } } ] @@ -68,7 +68,7 @@ messages = [ { "type": "image_url", "image_url": { - "url": "image_data/Gfp-wisconsin-madison-the-nature-boardwalk.jpg", + "url": "GKLN4qPXEAArqoK.png", } } ] @@ -104,7 +104,7 @@ def encode_image_to_base64(image_path): base64_message = base64_encoded_data.decode('utf-8') return base64_message -image_path = 'image_data/Gfp-wisconsin-madison-the-nature-boardwalk.jpg' +image_path = 'GKLN4qPXEAArqoK.png' encoded_image = encode_image_to_base64(image_path) ``` @@ -187,15 +187,15 @@ The output of these will be similar to this: { "index": 0, "message": { - "content": "The image features a beautiful wooden path lined with green grass and a blue sky overhead. The pathway leads towards a body of water, creating a serene atmosphere. Along the path, there is a bench overlooking the pond, inviting to sit and relax. The scene also includes trees in the background, adding to the picturesque scenery.\nWith the combination of the peaceful atmosphere, the sunny blue sky, and the presence of water nearby, this image", + "content": "In the image, there is a person standing on the back of a vehicle in a city. The vehicle is situated next to a taxi on the street. Another car can be seen approaching, and there is also a traffic light visible in the scene. The person standing on the vehicle could be a man drying his clothes, creating a unique and eye-catching sight. Additionally, a handbag is present near the person riding on the vehicle, likely belonging to them", "output": null, "role": "assistant" }, "status": "success" } ], - "created": 1722545890, - "id": "chat-xX9FDkWknG8G0ZHQjCgNdp47uBQZy", + "created": 1723228682, + "id": "chat-zstjj2MKpRdKfBmCMILK9wgx7I09N", "model": "llava-1.5-7b-hf", "object": "chat_completion" } diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index 9a4a432..2f4906d 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -779,7 +779,7 @@ paths: value: model: "bridgetower-large-itm-mlm-itc" input: - - text: "This is Bill Kennedy, a decent Go developer." + - text: "A person is ironing something while standing on the back of a taxi." image: "" responses: "403": From b159dd66a4aa0fad7776b260d23e21d92118a2c7 Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Fri, 9 Aug 2024 14:51:52 -0400 Subject: [PATCH 2/2] fixing missed image ref --- fern/docs/pages/reference/chat_vision.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fern/docs/pages/reference/chat_vision.mdx b/fern/docs/pages/reference/chat_vision.mdx index 809dafa..2664818 100644 --- a/fern/docs/pages/reference/chat_vision.mdx +++ b/fern/docs/pages/reference/chat_vision.mdx @@ -194,7 +194,7 @@ images that are base64 encoded represented by a data uri. ```bash curl -O 'https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png' - base64_img="$(base64 -i 2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg)" + base64_img="$(base64 -i GKLN4qPXEAArqoK.png)" cat < input.json {