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

请给我们的gpts 的插件增加历史数据的获取 #4

Open
iannono opened this issue Mar 26, 2024 · 2 comments
Open

请给我们的gpts 的插件增加历史数据的获取 #4

iannono opened this issue Mar 26, 2024 · 2 comments
Assignees

Comments

@iannono
Copy link

iannono commented Mar 26, 2024

目前我们通过 coinmarket cap 只能获得 1 个月内的数据。 我们希望能够获取到更早的数据, 可以通过我们自己的 position 的项目获取到。

但是如何在 gpts 里面支持多个 api, 需要弄明白怎么使用, 或者我们通过我们自己的 api, 集成进 coinmarket cap 也是可以的。

我们自己的 coin 数据拉取记录来自: https://github.com/brtr/coin_elite 这个项目

下面是我目前在 gpts 里面创建的 actions, 调用的是 coinmarket cap 的 api, 请做进一步的实现

https://chat.openai.com/g/g-VnVpO5spV-crypto-quant-expert

openapi: 3.0.0
info:
  title: CoinMarketCap API
  version: "1.0"
servers:
  - url: https://pro-api.coinmarketcap.com
paths:
  /v2/cryptocurrency/quotes/latest:
    get:
      summary: Get the latest cryptocurrency market quotes.
      operationId: getLatestQuotes
      parameters:
        - in: query
          name: symbol
          required: true
          schema:
            type: string
          description: The symbol of the cryptocurrency to get the latest market quote for.
        - in: query
          name: convert
          schema:
            type: string
          description: The fiat currency or cryptocurrency to convert the market quotes into.
      responses:
        '200':
          description: Successful response with the latest market quotes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestQuotesResponse'
      security:
        - apiKeyAuth: []
  /v3/cryptocurrency/quotes/historical:
    get:
      summary: Get historical market quotes for a cryptocurrency on a specific date.
      operationId: getHistoricalQuotes
      parameters:
        - in: query
          name: symbol
          required: true
          schema:
            type: string
          description: The symbol of the cryptocurrency to get historical market quotes for.
        - in: query
          name: time_start
          schema:
            type: string
            format: date
          description: Timestamp (Unix or ISO 8601) to start returning quotes for.
        - in: query
          name: time_end
          schema:
            type: string
            format: date
          description: Timestamp (Unix or ISO 8601) to stop returning quotes for (inclusive).
        - in: query
          name: count
          schema:
            type: number
          description: The number of interval periods to return results for.
        - in: query
          name: interval
          schema:
            type: string
            default: "daily"
          description: Interval of time to return data points for.
        - in: query
          name: convert
          schema:
            type: string
          description: The fiat currency or cryptocurrency to convert the historical market quotes into.
      responses:
        '200':
          description: Successful response with the historical market quotes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalQuotesResponse'
      security:
        - apiKeyAuth: []
  /v1/cryptocurrency/trending/latest:
    get:
      summary: Get the latest trending cryptocurrencies.
      operationId: getTrendingCryptocurrencies
      parameters:
        - in: query
          name: start
          schema:
            type: integer
          description: The starting index for the returned cryptocurrencies list.
        - in: query
          name: limit
          schema:
            type: integer
          description: The number of cryptocurrencies to return. Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
        - in: query
          name: time_period
          schema:
            type: string
            default: "24h"
          description: The starting index for the returned cryptocurrencies list.
        - in: query
          name: convert
          schema:
            type: string
          description: The fiat currency or cryptocurrency to convert the market quotes into.
      responses:
        '200':
          description: A list of the latest trending cryptocurrencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrendingLatestResponse'
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-CMC_PRO_API_KEY
  schemas:
    LatestQuotesResponse:
      type: object
      properties:
        data:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CryptocurrencyQuote'
    CryptocurrencyQuote:
      type: object
      properties:
        price:
          type: number
        volume_24h:
          type: number
        market_cap:
          type: number
        percent_change_24h:
          type: number
    HistoricalQuotesResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/HistoricalCryptocurrencyData'
    HistoricalCryptocurrencyData:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        symbol:
          type: string
        is_active:
          type: integer
        is_fiat:
          type: integer
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/QuoteDetail'
    QuoteDetail:
      type: object
      properties:
        timestamp:
          type: string
          format: date
        quote:
          $ref: '#/components/schemas/QuoteCurrency'
    QuoteCurrency:
      type: object
      properties:
        USD:
          $ref: '#/components/schemas/CurrencyDetail'
    CurrencyDetail:
      type: object
      properties:
        price:
          type: number
        volume_24h:
          type: number
        market_cap:
          type: number
        circulating_supply:
          type: number
        total_supply:
          type: number
        timestamp:
          type: string
          format: date
    TrendingCryptocurrency:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        symbol:
          type: string
        slug:
          type: string
        cmc_rank:
          type: integer
        is_active:
          type: boolean
        is_fiat:
          type: integer
        num_market_pairs:
          type: integer
        circulating_supply:
          type: number
        total_supply:
          type: number
        max_supply:
          type: number
        tags:
          type: array
          items:
            type: string
        quote:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Quote'
    Quote:
      type: object
      properties:
        price:
          type: number
        volume_24h:
          type: number
        percent_change_1h:
          type: number
        percent_change_24h:
          type: number
        percent_change_7d:
          type: number
        market_cap:
          type: number
    TrendingLatestResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TrendingCryptocurrency'
@0xRichardH
Copy link
Collaborator

You are a crypto expert who provides brief, to-the-point information and insights on cryptocurrencies. When users inquire about cryptocurrency prices or information, you now also retrieve the information of spot trading assets the user owns related to the queried cryptocurrency from the spot.techbay.club API. For the most current price data and real-time updates, you use the CoinMarketCap API to ensure the information reflects the latest market conditions. When displaying data, especially when presenting asset information or price comparisons, you present it in a table format whenever possible, making it easier for users to digest and compare the information. Your responses should be concise and include both your asset status for the specific cryptocurrency and the real-time market price, offering quick insights to help users grasp the essential information.
  • actions
image

@roofeel
Copy link
Collaborator

roofeel commented Apr 8, 2024

@iannono richard那边已经实现了,这个issue还需要处理什么

@roofeel roofeel assigned 0xRichardH and unassigned roofeel Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants