|
|
|
下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません |
|
fastapiでrouter部分を作成 組み込みはメイン部分でします |
|
フロントエンドをgradioで作成 |
|
#google apps script frontend |
|
googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し |
|
#google apps script backend |
|
frontendからの呼び出し用のバックエンドスクリプト |
|
仕様書の作成 |
|
PlantUMLでシーケンス図の作成 |
|
Markdownでのプログラム殺名 |
|
#下記参考にAPIも作成しておいて |
|
action insert list edit update でCRUDがかわる |
|
同じようにGASのAPIも作成しておいて |
|
|
|
def create_vector(): |
|
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True) |
|
outputs = model(**inputs) |
|
# [CLS]トークンの出力を取得 |
|
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist() |
|
print(embeddings) |
|
import requests |
|
|
|
url = "https://kenken999-php.hf.space/api/v1.php" |
|
|
|
payload = "model_name={embeddings}&vector_text={result}&table=products&action=insert"" |
|
headers = { |
|
'X-Auth-Token': 'admin', |
|
'Content-Type': 'application/x-www-form-urlencoded', |
|
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3' |
|
} |
|
|
|
response = requests.request("POST", url, headers=headers, data=payload) |
|
|
|
print(response.text) |
|
return True |
|
|
|
下記の質問 作成対応内容 |
|
|
|
こんにちは、リファスタのアシスタントです。 |
|
|
|
本日の金価格についてお問い合わせありがとうございます。金価格は常に変動していますが、現在の金価格は、33万8,000円です。 |
|
|
|
詳しくは、以下のURLをご覧ください。 |
|
https: |
|
|
|
また、以下のQ&Aをご覧ください。 |
|
|
|
Q: 金価格は何円ですか? |
|
A: 現在の金価格は、33万8,000円です。 |
|
|
|
Q: 金価格はどのように決まりますか? |
|
A: 金価格は、国際的な金価格に基づいて決定されます。 |
|
|
|
Q: リファスタでは、金は買取りますか? |
|
A: はい、リファスタでは、金を買取ります。詳しくは、以下のURLをご覧ください。 |
|
https: |
|
|
|
商品検索のURLは、以下の通りです。 |
|
https: |
|
|
|
宜しくお願いします。 |
|
下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません |
|
fastapiでrouter部分を作成 組み込みはメイン部分でします |
|
フロントエンドをgradioで作成 |
|
#google apps script frontend |
|
googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し |
|
#google apps script backend |
|
frontendからの呼び出し用のバックエンドスクリプト |
|
仕様書の作成 |
|
PlantUMLでシーケンス図の作成 |
|
Markdownでのプログラム殺名 |
|
#下記参考にAPIも作成しておいて |
|
action insert list edit update でCRUDがかわる |
|
同じようにGASのAPIも作成しておいて |
|
|
|
def create_vector(): |
|
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True) |
|
outputs = model(**inputs) |
|
# [CLS]トークンの出力を取得 |
|
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist() |
|
print(embeddings) |
|
import requests |
|
|
|
url = "https://kenken999-php.hf.space/api/v1.php" |
|
|
|
payload = "model_name={embeddings}&vector_text={result}&table=products&action=insert"" |
|
headers = { |
|
'X-Auth-Token': 'admin', |
|
'Content-Type': 'application/x-www-form-urlencoded', |
|
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3' |
|
} |
|
|
|
response = requests.request("POST", url, headers=headers, data=payload) |
|
|
|
print(response.text) |
|
return True |
|
|
|
下記の質問 作成対応内容 |
|
|
|
こんにちは、リファスタのアシスタントです。 |
|
|
|
本日の金価格についてお問い合わせありがとうございます。金価格は常に変動していますが、現在の金価格は、33万8,000円です。 |
|
|
|
詳しくは、以下のURLをご覧ください。 |
|
https: |
|
|
|
また、以下のQ&Aをご覧ください。 |
|
|
|
Q: 金価格は何円ですか? |
|
A: 現在の金価格は、33万8,000円です。 |
|
|
|
Q: 金価格はどのように決まりますか? |
|
A: 金価格は、国際的な金価格に基づいて決定されます。 |
|
|
|
Q: リファスタでは、金は買取りますか? |
|
A: はい、リファスタでは、金を買取ります。詳しくは、以下のURLをご覧ください。 |
|
https: |
|
|
|
商品検索のURLは、以下の通りです。 |
|
https: |
|
|
|
宜しくお願いします。 |