|
|
|
下記の質問に対応するコードを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 |
|
|
|
下記の質問 作成対応内容 |
|
|
|
以下は、顧客の質問内容を基にして、買取店の査定人に対してわかりやすい質問に変更したものです。 |
|
|
|
|
|
|
|
顧客の質問内容:まだ買取をするか未定ですが、一度査定をよろしくお願いします。 |
|
|
|
査定人向けの質問内容: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
以上のように、査定人のための質問を自動的に生成することで、査定速度を向上させることができます。 |