Skip to content

nlweb-ai/nlweb-typespec

Repository files navigation

NLWeb Protocol TypeSpec Specification

This repository contains the formal TypeSpec specification for the NLWeb protocol, which defines a standardized interface for natural language interactions with web endpoints.

What is NLWeb?

NLWeb provides two main endpoints:

  • Ask: Query endpoints with natural language and receive structured responses
  • Who: Discover which agents/tools can answer a given question

Using This Specification

For Python Developers

Use the companion nlweb_core Python library which provides Pydantic models.

For Other Languages

Generate types from the OpenAPI schema:

# View the generated schema
cat tsp-output/openapi/openapi.yaml

# Generate TypeScript types
npx openapi-typescript tsp-output/openapi/openapi.yaml -o nlweb-types.ts

# Generate Go types (example)
oapi-codegen -generate types -package nlweb tsp-output/openapi/openapi.yaml > nlweb.go

Development

Compile TypeSpec

npm install
npx tsp compile .

View Generated Schemas

cat tsp-output/openapi/openapi.yaml

Protocol Version

Current version: 0.5

Links

About

NLWeb TypeSpec Definition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published