メンバーシップ作った
この投稿見たら100回ブーストして!そして参加して!!
LINE×ChatGPT Bot簡単に作れるし、ラインから画像生成もできるよ
https://note.com/0235_jp/n/n94f91088343c
メンバーシップ作った
この投稿見たら100回ブーストして!そして参加して!!
LINE×ChatGPT Bot簡単に作れるし、ラインから画像生成もできるよ
https://note.com/0235_jp/n/n94f91088343c
iftttはZapierと違ってアクション一覧取れないからいい感じにChatGPTの実装変えずにアクション実行できないなぁとか思ってたけどいい方法ひらめいた。この方法ならifttt以外にも応用できるから便利だ
Code Interpreterってデータ解析とかに使う用かと思ってたけどテキストの保存とかもできんのか?
ちょっと後で調べよ
https://twitter.com/kajikent/status/1677916641026252801
LINEから出力したテキストのパースって凄まじく難しいんだけど、健気に何度もリトライしてる。
AutoGPTでも同じようなことできるかもだけど、やはりリトライしまくっても定額なのはすごい心強い。
# Lists to hold each column of the DataFrame
dates = []
times = []
senders = []
contents = []
# Process each line again
for line in lines:
# Check if the line matches the date format
date_match = re.match(date_pattern, line)
if date_match:
current_date = datetime.strptime(date_match.group(1), '%Y/%m/%d').date()
continue
# Check if the line matches the time and sender format
time_sender_match = re.match(time_sender_pattern, line)
if time_sender_match:
# Save the previous message if there is one
if current_content:
dates.append(current_date)
times.append(current_time)
senders.append(current_sender)
contents.append('\n'.join(current_content))
# Start a new message
current_time = time_sender_match.group(1)
current_sender = time_sender_match.group(2)
current_content = [re.sub(time_format_in_content_pattern, '', line[time_sender_match.end():])]
else:
# If the line is part of a message, add it to the current content
current_content.append(re.sub(time_format_in_content_pattern, '', line))
# Add the last message if there is one
if current_content:
dates.append(current_date)
times.append(current_time)
senders.append(current_sender)
contents.append('\n'.join(current_content))
# Create a DataFrame
df = pd.DataFrame({
'年': [d.year for d in dates],
'月': [d.month for d in dates],
'日': [d.day for d in dates],
'時間': times,
'送信者': senders,
'内容': contents
})
# Remove the first row
df = df.iloc[1:]
# Save the DataFrame to an Excel file
df.to_excel('/mnt/data/line_chat_history_corrected.xlsx', index=False)
df.head()
作ってもらったPythonのコードをアップして実行できるかと思ったけど、セキュリティの問題でそのまま実行はできないらしい
なので一旦コードを解釈して新たにコード生成するんだけどこれが違うコードになって実行されるから結果も変わっちゃう。。。
ファイルアップできるからたとえばAndroid⇒iOSのプロジェクトに変換できないかなぁとか思ったけどさすがに無理だった。
よくわかんないビルドエラーとか実行時エラーとかが出たときはプロジェクト丸ごとzipしてChatGPTのCode Interpreterに渡すといい感じにChatGPTに説明しやすくていいな。
コードコピペしなくていいしプロジェクト構造も理解して回答してくれる。
これ使いこなせたらすげえ楽できる。がChatGPTのWebは学習に使われるから機密性の高い仕事で使うときはサンプルプロジェクト作る必要はあるかも。