[ChatStream] matsuo-lab/weblab-10b-instruction-sft用の ChatPrompt

[ChatStream] matsuo-lab/weblab-10b-instruction-sft用の ChatPrompt

matsuo-lab/weblab-10b-instruction-sft 用の ChatPrompt クラスをリリースしました。
最新バージョンのChatStreamに取り込んでいますが、以下コードを使用することも可能です。

from chatstream import AbstractChatPrompt
from chatstream.chat_prompt.prompt_ttl import PromptTTL


class ChatPromptMatsuoLabJpGptNeoxInstSft(AbstractChatPrompt):

    def __init__(self):
        super().__init__()  # Call the initialization of the base class
        self.set_system("以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。")
        self.set_requester("指示")
        self.set_responder("応答")
        self.set_prefix_as_stop_str_enabled(True)  # enable requester's prompt suffix as stop str
        self.set_prompt_ttl(PromptTTL.SINGLE_TURN)

    def get_stop_strs(self):
        if not self.chat_mode:
            return None
        return ["Q:"]

    def get_replacement_when_input(self):
        return None

    def get_replacement_when_output(self):
        return None

    def create_prompt(self, opts={}):
        if self.chat_mode == False:
            return self.get_requester_last_msg()

        # Chat Mode == True の場合のプロンプトを構築する
        ret = self.system + "\n\n";

        for chat_content in self.get_contents(opts):

            chat_content_role = chat_content.get_role()
            chat_content_message = chat_content.get_message()
            chat_content_child_messages = chat_content.get_child_messages()
            has_child_messages = chat_content.has_child_messages()

            if chat_content_role:

                if chat_content_message:
                    merged_message = f"### {chat_content_role}: \n" + chat_content_message + "\n\n"
                    if has_child_messages:
                        merged_message += f"### 入力: \n"
                        chat_content_child_messages = chat_content.get_child_messages()
                        for message in chat_content_child_messages:
                            merged_message += message + "\n\n"
                else:
                    merged_message = f"### {chat_content_role}: "

                ret += merged_message

        return ret

    def build_initial_prompt(self, chat_prompt):
        # 初期プロンプトは実装しない
        pass


Read more

まだ毎回 /context を打っていますか?Claude Code のステータスラインにコンテキストと利用枠の残りを常時表示する

まだ毎回 /context を打っていますか?Claude Code のステータスラインにコンテキストと利用枠の残りを常時表示する

Claude Code でコンテキストの残量を見るために、毎回 /context を打つ必要はありません。ステータスラインに、コンテキストの使用率と 5 時間・週の利用枠の残りを常時表示する方法を、Windows と Node.js だけで動く 40 行足らずのスクリプトつきで紹介します。

By Qualiteg プロダクト開発部
Claudeのリセット権(上限のリセット)とは?Fableリセット・週次リセットで戻るものとChatGPTとの違い

Claudeのリセット権(上限のリセット)とは?Fableリセット・週次リセットで戻るものとChatGPTとの違い

Claude Fable 5.2 のリリース記念で配られたリセット権(上限のリセット)をご紹介します。使った利用枠を定期リセットを待たずに戻せる権利で、Fable リセットで戻るのは Fable で使った分です。週次リセットとの違い、もらえる件数、プランごとの期限、注意点、ChatGPT のリセットとの違いを、公式ヘルプと実際の画面をもとに整理します。

By Qualiteg プロダクト開発部
ゼロから作るコーディングエージェント【第6回】評価をどう作るか。動くものを作らせて自動採点し、採点器そのものを疑う

ゼロから作るコーディングエージェント【第6回】評価をどう作るか。動くものを作らせて自動採点し、採点器そのものを疑う

採点器の「テスト」10点が3日間ずっと0/0でした。点数の表を見ているだけでは気づけません。仕様書を渡してWebシステムを作らせ、起動して叩いて採点する評価装置の作り方、5種類×3本の合否基準、対照実験を先にやる理由、自作でない課題で「テストだけが決めている契約」を先に洗う話を、測った数字で書きます。

By Qualiteg プロダクト開発部