Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini に関するリクエストが部分的にうまく行かない #208

Open
5 tasks
nanai10a opened this issue Feb 15, 2024 · 3 comments
Open
5 tasks
Labels
bug Something isn't working wrapper

Comments

@nanai10a
Copy link
Sponsor Member

formal な詳細提供は保留しています


このようなエラーが表示される

image

Gemini は確かに messages の両端がユーザロールでない場合 (つまり LLM 側) に生成を拒否する仕様なのだが, どうにもユーザのメッセージを 2 つ繋げただけでもエラーが出力されている様子.

推測しているのは, 奇数個のメッセージ長さでないといけないか, 同一ロールのメッセージを連続して配置できないかのどちらかではないかと考えている.


ざっくりやること

  • 原因究明
  • エラー種別としてデータ型の定義に加える
  • 事前に検査し実装側から弾く
  • よりユーザフレンドリなエラーメッセージを提供する
  • (或いは) 無視できる範囲であればメッセージを矯正し返答可能な形式へ変換する様に実装を変更する
@nanai10a nanai10a added the bug Something isn't working label Feb 15, 2024
@m1sk9
Copy link
Contributor

m1sk9 commented Feb 15, 2024

2024-02-15T13:34:29.210400Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:34:29.210868Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:34:39.197902Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:34:39.198202Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:38:30.123614Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:38:30.123890Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:40:33.421981Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:40:33.422277Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T14:34:30.149934Z  INFO run:recv_event:handle_event:handle_gateway_dispatch: serenity::gateway::shard: [ShardInfo { id: ShardId(0), total: 1 }] Resumed event=Ok(Dispatch(5354, Resumed(ResumedEvent))) seq=5354 event=Resumed(ResumedEvent)

@m1sk9 m1sk9 added the wrapper label Feb 15, 2024
@m1sk9
Copy link
Contributor

m1sk9 commented Feb 17, 2024

2024-02-15T13:34:29.210400Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:34:29.210868Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:34:39.197902Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:34:39.198202Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:38:30.123614Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:38:30.123890Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T13:40:33.421981Z  WARN interaction_create:completion:next: ichiyo_ai::google: Unexpected status code res.status=400
2024-02-15T13:40:33.422277Z ERROR interaction_create:completion:next: ichiyo_ai::google: Receive error response error=Error { code: 400, message: "Please ensure that multiturn requests ends with a user role or a function response.", status: Lhs(InvalidArgument) }
2024-02-15T14:34:30.149934Z  INFO run:recv_event:handle_event:handle_gateway_dispatch: serenity::gateway::shard: [ShardInfo { id: ShardId(0), total: 1 }] Resumed event=Ok(Dispatch(5354, Resumed(ResumedEvent))) seq=5354 event=Resumed(ResumedEvent)

Containers2 は Docker Swarm なのでもうちょっとログを出すことも出来るけど, 情報量はそうでもないね.
ログシステムもう少し強化したいところではある

@nanai10a
Copy link
Sponsor Member Author

nanai10a commented Mar 3, 2024

ロギングに関して言えば, 何処のコードでどうエラーが出たのかを追えるような感じに留めていて, ログとコード併せて読むものという風にしているので… それ以上にする気持ちはありません (がそれに於いて必要な加筆修正には前向きです).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wrapper
Projects
None yet
Development

No branches or pull requests

2 participants