nowfound

Dev tools · December 27, 2024

Tysm, a Rust crate for using ChatGPT with Structured Outputs

Hi HN! This Christmas I made `tysm`, a rust crates which simplifies using ChatGPT with Structured Outputs. Essentially you just tell it the rust type you want the output to conform to, and it handles creating the JSON Schema, passing it to ChatGPT's chat-completions API, and deserializing the response. Structured Outputs are very useful because they guarantee that the response will conform to whatever type you expect. I'm already finding my crate very useful since I love using Structured Outputs but I hate writing JSON Schemas myself. Technical details for rust heads: To generate the JSON…

Tysm, a Rust crate for using ChatGPT with Structured Outputs launched on December 27, 2024 with 7 votes and more than 75% of that year's launches. The site was still online in September 2026, 1 year on.

What it does

Typed OpenAI Chat Completions in Rust. Contribute to anchpop/tysm development by creating an account on GitHub.

The Typed Chat Completions feature is the most interesting part, so most of this readme will focus on that. A strongly-typed Rust client for OpenAI's ChatGPT API that enforces type-safe responses using Structured Outputs . use tysm :: chat_completions :: ChatClient ; /// We want names separated into `first` and `last`. # [ derive ( serde :: Deserialize , schemars :: JsonSchema ) ] struct Name { first : String , last : String , } async fn get_president_name ( ) { // Create a client. // `from_env` will look for an API key under the environment // variable "OPENAI_API_KEY" // It will also look inside `.env` if such a file exists. let client = ChatClient :: from_env ( "gpt-4o" ) . unwrap ( ) ;…from github.com

In the maker’s words, at launch

Hi HN! This Christmas I made `tysm`, a rust crates which simplifies using ChatGPT with Structured Outputs. Essentially you just tell it the rust type you want the output to conform to, and it handles creating the JSON Schema, passing it to ChatGPT's chat-completions API, and deserializing the response. Structured…

Does a similar job

all alternatives →
  • Structured output from LLMs without reprompting2023 · automorphic.ai · ▲174

    Built a tool for transforming unstructured data into structured outputs using language models (with 100% adherence). If you're facing problems getting GPT to adhere to a schema (JSON, XML, etc.) or regex, need to bulk process some unstructured data, or generate synthetic data, check it out. We run our own tuned model (you can self-host if you want), so, we're able to have incredibly fine grained control over text generation. Repository: https://github.com/automorphic-ai/trex Playground: https://automorphic.ai/playground

  • GPT-JSON – Structured and typehinted GPT responses in Python2023 · github.com · ▲174

    Hey HN, I've been using GPT a lot lately in some side projects around data generation and benchmarking. During the course of prompt tuning I ended up with a pretty complicated request: the value that I was looking for, an explanation, a criticism, etc. JSON was the most natural output format for this but results would often be broken, have wrong types, or contain missing fields. There's been some positive movement in this space, like with jsonformer (https://github.com/1rgs/jsonformer) the other day. But nothing that was plug and play with GPT. This library consolidates…

  • Using zod to get structured and typed output from ChatGPT in TypeScript2023 · github.com · ▲35

    Contribute to olup/zod-chatgpt development by creating an account on GitHub.

  • No more copy-pasting – a ChatGPT plugin to read code from your computer2023 · github.com · ▲46

    Introducing the Code ChatGPT Plugin - a new era of seamless interaction between ChatGPT and your codebase. This TypeScript Code Analyzer furnishes a suite of utilities to analyze TypeScript code, enabling ChatGPT to "talk" with YOUR code. Fetch a list of all the files in your project, list of every function in a TypeScript or JavaScript file, or even get the content of a specific function, all while staying in your conversation with ChatGPT. With accessible API endpoints, you can effortlessly navigate your codebase and ask ChatGPT anything you can think of about it. Say goodbye to the days…

  • An opinionated and statically-typed TypeScript SDK generator2022 · easysdk.xyz · ▲81

    Hi Hacker News! My name is Sagar, I’m working on a startup called Speakeasy - we’re making all APIs self-service. The platform is currently in beta, but we’re independently launching this tool which you can use to generate language-idiomatic, statically-typed TS SDKs from any public OpenAPI schemas. We hope to continue iterating on this to give devs a way to easily generate high fidelity client SDKs for all the major languages. Inspiration for this product is from past experiences struggling with OpenAPI. I was originally optimistic about using the OpenAPI tools to build out our offering,…

  • JQL – A JSON Query Language CLI Tool Built with Rust2020 · crates.io · ▲25

    crates.io serves as a central registry for sharing crates, which are packages or libraries written in Rust that you can use to enhance your projects

More dev tools this month

the category →
  • /dev/null▲490

    a social network for devs

    Dev tools · 4d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 29d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 27d ago · github.com

  • Contribute to oosexgang/hackios-xnu-kernel development by creating an account on GitHub.

    Dev tools · 14h ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 24d ago · openbot.run

  • Talanoa▲346

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 21d ago · talanoa.email

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, December 2024

the whole month →
  • Remy AI▲2,170

    Anyone can sleep and recover better

    AI · 2024 · apps.apple.com

  • Remento▲1,681

    The AI biographer for loved ones

    AI · 2024 · remento.co

  • Aimfox▲1,213

    Built for LinkedIn outreach, made to close deals

    Growth · 2024 · aimfox.com

  • Stackfix▲1,112

    Compare software in seconds

    AI · 2024 · stackfix.com

  • Coval▲1,012

    Simulation & evals to ship delightful voice & chat AI agents

    AI · 2024 · coval.ai

  • VocAdapt▲961

    Master languages with AI-adapted authentic content

    Life & fun · 2024 · vocadapt.com