ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Remove Langfuse Dependency for Session ID Grouping in Response API

オープン
#270 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug good first issue
主要言語
Python
スター
18
フォーク
10
平均マージ
2日 20時間
マージ済み PR(30日)
14

説明

Currently, in the Response API, we derive the session_id from Langfuse by querying it using the previous response_id, as shown below:

if response_id:
    traces = self.langfuse.fetch_traces(tags=response_id).data
    if traces:
        self.session_id = traces[0].session_id

This approach introduces an unnecessary runtime dependency on Langfuse, solely to group related traces under the same session for visualization purposes.

OpenAI does not currently provide a native conversation ID for API responses, which complicates session tracking.
We are in discussions with OpenAI to potentially add support for a conversation_id or similar identifier at their end which we can pass to langfuse as session_id.

Alternative: Maintain the session or conversation-level grouping within the Glific flow context itself, so that Langfuse becomes an observer rather than a source of truth for session identity.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

この issue では、Response API のパスと既存の Langfuse トレース検索がエントリーポイントとして示されています。ファイルやテストは指定されていません。まず response_id と session_id がどこで管理されているかを確認し、次に、実行時の Langfuse 検索なしでもセッションのグループ化が一貫して維持されることを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend, observability
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
28/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。