Chat demo App: How to fetch function arguments on the view?

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

メンテナーはふだん 2 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
swift
領域
mobile

調査の方向性

Start by reading the Chat demo’s message model and view, especially the case .function rendering shown in the issue, then trace where function-call arguments are stored in the Swift package. The request is to make individual arguments available to the view for uses such as tables or graphs; done means the demo can access a requested property such as degrees. The issue has had no comment for 529 days, so confirm the approach with maintainers before starting.

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

説明

Is your feature request related to a problem? Please describe.
Would be great to be able to fetch function arguments on the view.

Describe the solution you'd like

When defined:

  let weatherFunction = ChatFunctionDeclaration(
            name: "getWeatherData",
            description: "Get the current weather in a given location",
            parameters: .init(
              type: .object,
              properties: [
                "location": .init(type: .string, description: "The city and state, e.g. San Francisco, CA"),
                "degrees": .init(type: .string, description: "The degrees, in celsius. Ex: 10c")

              ],
              required: ["location"]
            )
        )

When prompted "show me the weather in San Francisco"...

Current demo app shows the on the bubble: message.content
Would be great to be able to fetch the property, ex: function.degrees.

This would enable to place specific function properties on tables, graphs, etc...


 var body: some View {
        HStack {
            switch message.role {
            case .assistant:
                Text(message.content)
                    .padding(.horizontal, 16)
                    .padding(.vertical, 12)
                    .background(assistantBackgroundColor)
                    .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
                Spacer(minLength: 24)
            case .user:
                Spacer(minLength: 24)
                Text(message.content)
                    .padding(.horizontal, 16)
                    .padding(.vertical, 12)
                    .foregroundColor(userForegroundColor)
                    .background(userBackgroundColor)
                    .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
            case .function:
              Text(message.content)
                  .font(.footnote.monospaced())
                  .padding(.horizontal, 16)
                  .padding(.vertical, 12)
                  .background(funcBackgroundColor)
                  .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
              Spacer(minLength: 24)
            case .system:
                EmptyView()
            }
        }
    }
主要言語
Swift
スター
2.9k
フォーク
519
平均マージ
3日 12時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

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

MacPaw/OpenAI のほかの issue

MacPaw/OpenAI の issue をすべて見る

似ている issue

Swift の issue をもっと見る

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

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