neo yang

Copywriter, webmaster, product manager, architect, independent developer.

Review of virtual airline business lines - supply chain growth and structure

1. The overall situation of air tickets 1. Business ecology Since the great development of the Internet and OTA, the air ticket business has gradually formed two business forms: platform and supply chain. […]

Time:2023/09/02

form engine iteration today

Today’s iteration of form engine:

Support multiple forms on one page;

Supports application in veiws engine, so that various actions can be added to the list rendered by veiws engine.

The view layer and control layer of the form engine are separated.

Add a field for a drop-down selection button.

 

Since the form engine and views engine were separated from the low-code platform and some reconstruction was done, this iteration has completely made their capabilities beyond the previous version.

Time:2023/08/31

For the record, setting cookies in WordPress is special.

I've been stuck on this little problem for a day.

Setting cookies in WordPress is special.It should be written in the theme's functions file and loaded into the init hook.

function custom_set_cookie() { setcookie( 'key', 'value', time() + 3600 * 24, COOKIEPATH, COOKIE_DOMAIN ); } add_action( 'init', 'custom_set_cookie' );
tags:

Dismantle the low-code platform - generative is the direction of low-code

Friends who are familiar with me know that during the epidemic, I coded myself and built a BAAS (back-end as a service cloud computing platform) and a low-code platform. The reason […]

Why do people who care about money often fail to make big money? ——Read "Why Greatness Cannot Be Planned"

  Why do people who care about money often fail to make big money? Since this year, GPT has been very popular. There is also a book related to artificial intelligence, which also has […]

The first wave of AIGC entrepreneurial teams have been disbanded. Is there still a future for AIGC?

Today, a friend shared an article. Recently, Jasper, the first unicorn company to do AIGC, has returned to zero. Jasper, based on GPT, is […]

The direction of generative AI—a breakthrough in robots

  AI is a big opportunity. Therefore, everyone is exploring, whether they know what to do or what they don’t know what to do. At present, the direction of exploration is mainly in […]

Time:2023/08/01

Flutter package dependency conflict problem (Because xx depends on)

The simplest solution is to add "any" instead of the version number after the conflicting package, so that Flutter will automatically match the appropriate version of the package dependency.

dart_code_metrics: any

 

tags:
Time:2023/07/29

the_posts_pagination() ——wordpress paging principle


I have never understood the paging principle of wordpress lists. I finally figured it out today.

The list and pagination data of wordpress are written in the global parameter: $wp_query. As long as the queried list data is put into this parameter, you can use the_posts_pagination() or get_the_posts_pagination() to display the pagination. As for the page that appears after clicking the pagination, Don't worry, wordpress has already done it.

Code:

global $wp_query; 

 $wp_query=new WP_Query($arg);

Then, you can use the_posts_pagination() to display pagination under this list.



tags:
Time:2023/07/26

AIGC: Integrate Baidu’s Wenxin Qianfan large model into WordPress and compare it with GPT

# integrates Baidu’s Wenxin Qianfan large model into WordPress and compares it with GPT

Last weekend, Baidu’s Wenxin Qianfan model was integrated into WordPress.
1. Basic process:
1. First apply to experience the Wenxin Qianfan large model on Baidu, which requires certification first.

2. After passing, activate the large model, because Baidu's large model is charged for use and is charged by token. You need to have a balance in your account to activate it.

3. Then, create an application so that it has appid, api key and secret key

4. Then, read the documentation and connect the corresponding interface.
Basically, you get the access token through the api key and secret key, and then submit the question and get the answer.

2. Key code
1. Obtain the key code of the access token

"`php
private function getAccessToken(){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://aip.baidubce.com/oauth/2.0/token?client_id=”.$this->client_id.”&client_secret=”.$this->client_secret.”&grant_type=client_credentials”,
CURLOPT_TIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json'
),

));
$response = curl_exec($curl);
curl_close($curl);
$rtn = json_decode($response);
return $rtn->access_token;
}
“`

2. Call the key code of Ernie Bot large model

"`php
public function runErnieBot($message) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token={$this->getAccessToken()}”,
CURLOPT_TIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>$message,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
“`

3. Call the key code of Ernie Bot Turbo large model

"`php
public function runErnieBotTurbo($message) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant?access_token={$this->getAccessToken()}”,
CURLOPT_TIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>$message,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
“`

In the past few days of testing, the performance of Baidu Wenxin Qianfan's large model in Chinese is indeed much better than GPT.
The Chinese level of GPT is the level of "explanatory text".
The Chinese level of Baidu Wenxin Qianfan Large Model is at least better than the "explanatory text".


copyright © www.lyustu.com all rights reserved.
Theme: TheMoon V3.0. Author:neo yang