Limitations of Gemini 2 for Content Extraction

Gemini 2 is helpful for creating good content for project management but there is no way to extract the responses. Copy and paste chnges formats and is not very helpful.

Hi @Harpreet, Welcome to the forum !!!

Could you please provide a bit more clarification on this? Are you trying to copy whole response or trying to extract some entities from the response??

Hello @Harpreet. Since we are not sure of how you are making the call, you can either pipe the responses to file using jq -r “$filename” or save the entire response as using -o “$filename” flag. Below is an example for piping:

curl -X POST \
     -H "Content-Type: application/json" \
     -H "x-goog-api-key: $GOOGLE_API_KEY" \
     -d '{
           "contents": [{
             "parts":[{
               "text": "Write a story about a magic backpack."}]}]}' \
     "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=$GOOGLE_API_KEY" |
     jq -r '.candidates[0].content.parts[0].text' > response.txt

This is good for integration but i was trying just a very basic leta say copy the table format answer and paste it to an email or a word doc

1 Like