How to read/extract text from PDFs through google drive api in custom gpt?

We are facing problem when using Custom GPT actions to read a PDF file stored on Google Drive, Although the connection to the Google API works perfectly for Google Docs, it seems unable to read or extract the text from PDF files. I’m attaching the problem message given by Custom GPT for your reference and the schema we used (1st schema is accessing and downloading the pdf file but could not able to read the content where as in the 2nd schema we wanted to change its document’s format from pdf and then try to read it but we unable to do it) .[enter image description here](https://i.sstatic.net/UmJgd6fE.jpg)

  • openapi: 3.1.0
    info:
      title: Google Drive PDF API
      description: API to interact with Google Drive for handling PDF files, including listing, downloading, and converting PDF files.
      version: 1.0.0
    servers:
      - url: https://www.googleapis.com/drive/v3
        description: Google Drive API v3
    paths:
      /files:
        get:
          operationId: listPDFFiles
          summary: List PDF files in Google Drive
          description: Retrieves a list of PDF files in the user's Google Drive.
          parameters:
            - name: q
              in: query
              description: Query string for searching files. Only PDFs will be returned.
              required: false
              schema:
                type: string
                example: "mimeType='application/pdf'"
            - name: fields
              in: query
              description: Selector specifying a subset of fields to include in the response.
              required: false
              schema:
                type: string
                example: "files(id,name,mimeType)"
          responses:
            '200':
              description: A list of PDF files
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      files:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            mimeType:
                              type: string
      /files/{fileId}:
        get:
          operationId: downloadPDFFile
          summary: Download a PDF file from Google Drive
          description: Downloads a PDF file from Google Drive by its file ID.
          parameters:
            - name: fileId
              in: path
              description: The ID of the PDF file to download.
              required: true
              schema:
                type: string
          responses:
            '200':
              description: PDF file downloaded successfully
              content:
                application/octet-stream:
                  schema:
                    type: string
                    format: binary
      /files/{fileId}/export:
        get:
          operationId: convertPDFFile
          summary: Convert a PDF file to another format
          description: Converts a PDF file from Google Drive to a specified format (e.g., text or image).
          parameters:
            - name: fileId
              in: path
              description: The ID of the PDF file to convert.
              required: true
              schema:
                type: string
            - name: mimeType
              in: query
              description: The MIME type of the format to convert the PDF file to. Example formats could include "text/plain" or "image/png".
              required: true
              schema:
                type: string
                example: "text/plain"
          responses:
            '200':
              description: PDF file converted successfully
              content:
                application/octet-stream:
                  schema:
                    type: string
                    format: binary
    components:
      securitySchemes:
        apiKeyAuth:
          type: apiKey
          in: query
          name: key
      schemas:
        File:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            mimeType:
              type: string
    security:
      - apiKeyAuth: []
    

schema 2:

  • openapi: 3.1.0
    info:
      title: Google Drive PDF API
      description: API to interact with Google Drive for handling PDF files, including listing and downloading PDF files.
      version: 1.0.0
    servers:
      - url: https://www.googleapis.com/drive/v3
        description: Google Drive API v3
    paths:
      /files:
        get:
          operationId: listPDFFiles
          summary: List PDF files in Google Drive
          description: Retrieves a list of PDF files in the user's Google Drive.
          parameters:
            - name: q
              in: query
              description: Query string for searching files. Only PDFs will be returned.
              required: false
              schema:
                type: string
                example: "mimeType='application/pdf'"
            - name: fields
              in: query
              description: Selector specifying a subset of fields to include in the response.
              required: false
              schema:
                type: string
                example: "files(id,name,mimeType)"
          responses:
            '200':
              description: A list of PDF files
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      files:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            mimeType:
                              type: string
      /files/{fileId}:
        get:
          operationId: downloadPDFFile
          summary: Download a PDF file from Google Drive
          description: Downloads a PDF file from Google Drive by its file ID.
          parameters:
            - name: fileId
              in: path
              description: The ID of the PDF file to download.
              required: true
              schema:
                type: string
          responses:
            '200':
              description: PDF file downloaded successfully
              content:
                application/octet-stream:
                  schema:
                    type: string
                    format: binary
      /files/{fileId}/export:
        get:
          operationId: convertPDFFile
          summary: Convert a PDF file to another format
          description: Converts a PDF file from Google Drive to a specified format (e.g., text or image).
          parameters:
            - name: fileId
              in: path
              description: The ID of the PDF file to convert.
              required: true
              schema:
                type: string
            - name: mimeType
              in: query
              description: The MIME type of the format to convert the PDF file to. Example formats could include "text/plain" or "image/png".
              required: true
              schema:
                type: string
                example: "text/plain"
          responses:
            '200':
              description: PDF file converted successfully
              content:
                application/octet-stream:
                  schema:
                    type: string
                    format: binary
    components:
      securitySchemes:
        apiKeyAuth:
          type: apiKey
          in: query
          name: key
      schemas:
        File:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            mimeType:
              type: string
    security:
      - apiKeyAuth: []
    

The goal is to use the Google Drive API to access and retrieve these PDF files, and then use a custom GPT (Generative Pre-trained Transformer) model to read and extract text from them. The extracted text will be used for further processing.

Expected Outcome: A solution that can access PDF files in Google Drive, extract the text from them, and integrate this text with a custom GPT model for various applications, such as content analysis or automated summarization.

New contributor

clustering is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật