채팅 GPT 처리 거래소에 대한 새로운 발표

저자:차오장, 날짜: 2023-04-03 13:49:13
태그:

거래소 상장 시간 불일치 문제를 해결하는 효과적인 방법은 ChatGPT를 사용하여 처리하는 것이며 정규 표현을 사용하여 번거로운 매칭을 피하는 것입니다. 게시물을 ChatGPT에 직접 전달하여 다양한 거래소의 시간 형식을 식별하고 처리하도록하는 것이 쉽고 효율적인 응용 시나리오입니다.

공지 문자를 openaiCompletions 기능에 전달함으로써, 당신은 다양한 거래소의 상자 공지로부터 중요한 정보를 추출하기 위해 ChatGPT의 강력한 능력을 활용할 수 있다. 이 방법은 처리 효율성을 향상시킬 뿐만 아니라 다른 시간 형식에 대한 호환성을 향상시킨다.

이 함수를 사용하기 전에 OPENAI_API_KEY라는 정책 매개 변수를 설정해야 합니다. 이 매개 변수는 OpenAI API 키를 제공하는 데 사용됩니다. gpt-3.5-turbo API에 접근하기 위해 자신의 키를 사용할 수 있습니다.

함수 이름:openaiCompletions

기능 설명: 이 함수는 OpenAI의 gpt-3.5-turbo 모델을 호출하여 입력된 공지 내용이 거래소 현장에서 새로운 거래 쌍의 공지인지 여부를 판단합니다. 공지 조건이 충족되면 함수는 성공 표지, 거래 쌍 및 베이징 시간을 포함하는 JSON 객체를 반환합니다. 공지 조건이 충족되지 않으면 실패 표지만을 반환합니다.

입력된 매개 변수: 컨텐츠: 판단해야 할 광고 내용.

그 결과: JSON 객체, 다음 키값 쌍을 포함:

success: Boole 값, 판단 결과가 성공했는지 여부를 나타냅니다. pair: (success가 true일 때만 존재한다) 문자열 배열, 트랜잭션 쌍을 나타냅니다. time: (success가 true일 때만 존재한다) 문자열, 발표 시기를 나타냅니다. 베이징 시간 (UTC+8) 로 변환되었습니다. 함수의 실행 과정:

요청 gpt-3.5-turbo API의 URL, 요청 헤더 및 요청 데이터를 정의합니다. HttpQuery 메소드를 호출하여 JSON 형식으로 요청 데이터를 gpt-3.5-turbo API에 전송합니다. gpt-3.5-turbo API에서 반환된 JSON 데이터를 분석하고 필요한 정보를 추출합니다. 처리된 JSON 객체를 반환합니다.

예를 들어:

var content = "某交易所宣布,将于2023年3月22日12:00(UTC+8)上线ID/USDT交易对。";
var result = openaiCompletions(content);
Log(result);

그 결과:

{
  "success": true,
  "pair": ["ID_USDT"],
  "time": "2023-03-22 12:00:00"
}



// 封装的函数
function openaiCompletions(content) {
    var url = 'https://api.openai.com/v1/chat/completions';
    var headers = 'Content-Type: application/json\nAuthorization: Bearer ' + OPENAI_API_KEY;
    var data = {
        model: 'gpt-4',//如果api没有gpt-4的权限,这里可以修改为gpt-3.5-turbo
        messages: [
          {role: "system", "content": '判断公告内容,是交易所现货上新交易对的公告吗?如果是你只需要以json的{"success":true,"pair":["ID_USDT"],"time":"2023-03-22 12:00:00"}格式,时间转换为北京时间utc+8,如果不是返回{"success":false}'},
          {role: 'user', content: content}
          ]
    };

    var response = HttpQuery(url, JSON.stringify(data),null,headers,false);
    response = JSON.parse(response)
    return JSON.parse(response.choices[0].message.content);
}

// 使用示例
function main() {
    let announcement = `Fellow Binancians,
Binance will list Radiant Capital (RDNT) in the Innovation Zone and will open trading for these spot trading pairs at 2023-03-30 07:30 (UTC):
New Spot Trading Pairs: RDNT/BTC, RDNT/USDT, RDNT/TUSD
Users can now start depositing RDNT in preparation for trading
Withdrawals for RDNT will open at 2023-03-31 07:30 (UTC)
RDNT Listing Fee: 0 BNB
Users will enjoy zero maker fees on the RDNT/TUSD trading pairs until further notice
Note: The withdrawal open time is an estimated time for users’ reference. Users can view the actual status of withdrawals on the withdrawal page.
In addition, Binance will add RDNT as a new borrowable asset with these new margin pairs on Isolated Margin, within 48 hours from 2023-03-30 07:30 (UTC):
New Isolated Margin Pairs: RDNT/USDT
Please refer to Margin Data for a list of the most updated marginable assets and further information on specific limits and rates.
What is Radiant Capital (RDNT)?
Radiant Capital is a decentralized omnichain money market protocol. Users can stake their collateral on one of the major chains and borrow from another chain. RDNT is the utility token for liquidity mining and governance.
Reminder:
The Innovation Zone is a dedicated trading zone where users are able to trade new, innovative tokens that are likely to have higher volatility and pose a higher risk than other tokens.
Before being able to trade in the Innovation Zone, all users are required to visit the web version of the Innovation Zone trading page to carefully read the Binance Terms of Use and complete a questionnaire as part of the Initial Disclaimer. Please note that there will not be any trading restrictions on trading pairs in the Innovation Zone.
RDNT is a relatively new token that poses a higher than normal risk, and as such will likely be subject to high price volatility. Please ensure that you exercise sufficient risk management, have done your own research in regards to RDNT’s fundamentals, and fully understand the project before opting to trade the token.
Details:
Radiant Capital Website
RDNT Token Contract Addresses - Arbitrum, BNB Chain
Fees
Rules
Thanks for your support!
Binance Team
2023-03-30`
Log(openaiCompletions(announcement))

}


더 많은

xxs1xxs1새로운 것을 만들 수 있을까요?

펑91결코 그렇지 않노라