tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.19k stars 213 forks source link

Write a transformer to create better type names for configurations using LLM #2200

Open tusharmath opened 2 weeks ago

tusharmath commented 2 weeks ago

Currently autogenerated configurations can sometimes have not-so-readable type names. We want to use LLMs to produce more meaningful type-names

Before

type T1 {
  name: String
  age: Int
  gender: Gender
}

type T2 {
  name: String
  address: Address
  reviews: [Review]
}

After A simple instruction like below to chat gpt can produce a more meaningful configuration

Generate better names for T1 and T2 and produce a new schema file with the new names.

type Person {
  name: String
  age: Int
  gender: Gender
}

type Business {
  name: String
  address: Address
  reviews: [Review]
}

Technical Requirements

Additional Information A sample transformer is written over here https://github.com/tailcallhq/tailcall/tree/main/src/core/config/transformer