Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#99 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
swift
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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()
            }
        }
    }
Lingua principale
Swift
Stelle
2.9k
Fork
519
Merge medio
4g 9h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MacPaw/OpenAI

Tutte le issue di MacPaw/OpenAI

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.