Skip to content
Getting Gemini prom...
 
Notifications
Clear all

Getting Gemini prompt completions

11 Posts
3 Users
0 Reactions
6 Views
Beata_Tali_Gold
(@beata_tali_gold)
Posts: 5
Active Member
Topic starter
 

Hello everyone,

I've been attempting to retrieve prompt completions from Gemini, as it offers advantages over OpenAI. I haven't managed to achieve this straightforward task all day. I've experimented with numerous modules, including the HTTP API call and all the Gemini-specific modules.

My ultimate objective is to input the title and body of a Reddit post and receive a Gemini-generated response to that post. I appreciate any assistance.

 
Posted : 24/06/2024 11:12 pm
samliew
(@samliew)
Posts: 293
Reputable Member
 

Welcome to the callin.io community!

You can get a Gemini API token here https://ai.google.dev/gemini-api/docs/api-key

If you require assistance with setting up the HTTP module, kindly provide more details about your attempts concerning the external service's Developer API Reference – how you are configuring the connection, a link to the endpoint you are trying to access, and any errors you are encountering.

You can also complete this new course/tutorial in the callin.io Academy on utilizing external APIs — API calls with HTTP modules

  • API and Endpoints
  • Header and body
  • Multipart/form-data
  • OAuth 2.0

samliewrequest private consultation

Join the callin.io Fans Discord server to chat with other makers!

Please provide the rewritten markdown content *it should be in the markdown format.

 
Posted : 25/06/2024 1:11 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

To establish a connection within the HTTP module using "API Key Auth,"

When invoking the generateContent endpoint, as detailed here

No additional headers or query parameters are necessary.

Output

callin.iorequest private consultation

Join the callin.io Fans Discord server to chat with other makers!

 
Posted : 25/06/2024 1:23 am
Msquare_Automation
(@msquare_automation)
Posts: 88
Estimable Member
 

Hi there,

Have you experimented with callin.io's verified Gemini app?

If you've tried it and it didn't function as expected, could you please share the input prompt so we can understand the issue thoroughly?

Should you need further assistance, please feel free to get in touch.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

 
Posted : 25/06/2024 1:35 am
Beata_Tali_Gold
(@beata_tali_gold)
Posts: 5
Active Member
Topic starter
 

Thanks! I tried that and received a 400 error. I'm confident the API key is correct, as it has successfully connected previously.

 
Posted : 25/06/2024 2:28 am
Beata_Tali_Gold
(@beata_tali_gold)
Posts: 5
Active Member
Topic starter
 

Yes, I did. For the chat prompt module, it worked one time and then ceased to function afterwards…

For the text prompt module, I intend to use Gemini Pro instead of Unicorn, so I did not utilize it.

For the API Call module, I was unable to get it to work… the URL for the API call differs from the documentation, so perhaps that is related to the issue…

 
Posted : 25/06/2024 2:33 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

You can try obtaining a new API key, or you can share the complete error message, scenario details, output bundles, and so forth.

1. Screenshots of module fields and filters

Please provide screenshots of the relevant module fields and filters in question. This would greatly assist other community members in understanding your setup.

You can upload images here using the Upload icon in the text editor:

2. Scenario blueprint

Please export the scenario blueprint file to enable others to review the mappings and settings. At the bottom of the scenario editor, you can find the Export Blueprint option by clicking on the three dots.

(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will appear as follows:

blueprint.json (12.3 KB)

3. And most importantly, Input/Output bundles

Please provide the output bundles from the trigger/iterator/aggregator modules by running the scenario (or retrieve them from the scenario History tab). Then, click the white speech bubble in the top-right of each module and select “Download input/output bundles”.

A.

Save the contents of each bundle in your text editor as a bundle.txt file and upload it to this discussion thread.

Uploading them here will look like this:

module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, you can alternatively paste the formatted bundles in this way:

  • Either enclose the content with three backticks ``` before and after, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:

Providing the input/output bundles will enable others to replicate the scenario's behavior, even if they don't use the external service.

Following these steps will help others assist you. Thank you!

Join the callin.io Fans Discord server to chat with other makers!

 
Posted : 25/06/2024 2:53 am
Beata_Tali_Gold
(@beata_tali_gold)
Posts: 5
Active Member
Topic starter
 

blueprint.json (9.6 KB)

input:

[
    {
        "ca": null,
        "qs": [],
        "url": "https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent",
        "data": "{contents":[n            {n"role": "user",
              "parts":[{"text": "Give me five subcategories of jazz?"}]}]}",
        "gzip": true,
        "method": "post",
        "headers": [
            {
                "name": "Content-Type",
                "value": "application/json"
            }
        ],
        "timeout": null,
        "useMtls": false,
        "bodyType": "raw",
        "contentType": "application/json",
        "serializeUrl": false,
        "shareCookies": false,
        "parseResponse": true,
        "followRedirect": true,
        "useQuerystring": false,
        "followAllRedirects": false,
        "rejectUnauthorized": true
    }
]

output:

[
    {
        "statusCode": 400,
        "headers": [
            {
                "name": "vary",
                "value": "Origin, X-Origin, Referer"
            },
            {
                "name": "content-type",
                "value": "application/json; charset=UTF-8"
            },
            {
                "name": "content-encoding",
                "value": "gzip"
            },
            {
                "name": "date",
                "value": "Tue, 25 Jun 2024 04:14:56 GMT"
            },
            {
                "name": "server",
                "value": "scaffolding on HTTPServer2"
            },
            {
                "name": "cache-control",
                "value": "private"
            },
            {
                "name": "x-xss-protection",
                "value": "0"
            },
            {
                "name": "x-frame-options",
                "value": "SAMEORIGIN"
            },
            {
                "name": "x-content-type-options",
                "value": "nosniff"
            },
            {
                "name": "server-timing",
                "value": "gfet4t7; dur=57"
            },
            {
                "name": "alt-svc",
                "value": "h3=":443"; ma=2592000,h3-29=":443"; ma=2592000"
            },
            {
                "name": "connection",
                "value": "close"
            },
            {
                "name": "transfer-encoding",
                "value": "chunked"
            }
        ],
        "cookieHeaders": [],
        "data": {
            "error": {
                "code": 400,
                "message": "Invalid JSON payload received. Expected : between key:value pair.n{contents":[n            {n"rn         ^",
                "status": "INVALID_ARGUMENT"
            }
        },
        "fileSize": 202
    }
]
 
Posted : 25/06/2024 4:18 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

Your JSON was invalid. You can verify it by copy-pasting into https://jsonformatter.org , and it will indicate any errors and their locations.

JSON is very strict. You need to ensure the format is correct, with all keys properly double-quoted, and so on.

You are missing a double-quote before the key "contents"

Join the callin.io Fans Discord server to chat with other makers!

 
Posted : 26/06/2024 3:14 am
Beata_Tali_Gold
(@beata_tali_gold)
Posts: 5
Active Member
Topic starter
 

Thanks!!! That worked for me.

 
Posted : 26/06/2024 6:10 pm
samliew
(@samliew)
Posts: 293
Reputable Member
 

You're welcome, happy to assist!

  1. For any future questions, please initiate a new thread. This helps others with similar issues find answers more easily, and you're more likely to get a response as new questions are actively monitored.

  2. The callin.io Community guidelines recommend marking helpful replies as solutions to maintain organization within the Community.

This action marks the topic as resolved, which:

  • allows others to save time when reviewing recent activity, and
  • enables others to quickly access the solution if they encounter the same challenge.

To do this, simply select the checkbox located at the bottom of the post that addresses your question:

Screenshot_2023-10-04_161049

  1. Remember to like and bookmark this topic for easy future reference!

  2. Feel free to join the unofficial callin.io Discord server for real-time chat and video support.

Join the callin.io Fans Discord server to chat with fellow users!

 
Posted : 27/06/2024 1:27 am
Share: