F: Add missing TypeSpec type definitions (errors, tracing, streaming, validation, wire)#350
Merged
Merged
Conversation
…lidation, wire) Add new TypeSpec model files for types specified in spec.md but not yet modeled: - F1: Error types (InvokerError, ValidationError, FileNotFoundError) in core/errors.tsp - F2: Tracing types (TraceValue, TraceTime, TraceSpan, TraceFile) in tracing/tracer.tsp - F3: Streaming types (StreamOptions) in streaming/stream.tsp - F4: Validation types (ValidationResult) in core/validation.tsp - F5: Anthropic wire format types (content blocks, messages, request/response) in wire/anthropic-types.tsp All types include @doc annotations and @sample examples matching the spec. Generated code emitted to all runtimes (Python, TypeScript, Go, Rust, C#). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… paths - Add FileNotFoundError, InvokerError, ValidationError, ValidationResult to model/core/__init__.py and model/__init__.py (generated files missing exports) - Fix 73 generated TS test files: ../../src/model/index -> ../../../src/model/index (wrong depth for tests in tests/model/<group>/ subdirectories, pre-existing from E1) - Fix 5 hand-written TS tests: ../src/model/prompty.js / ../src/model/tool.js -> ../src/model/index.js (E1 moved files to subdirs, breaking direct imports) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Auto-fixed 21 import-block ordering errors (I001) flagged by ruff check: - 17 test files: yaml import must follow stdlib imports with blank line separator - _StreamOptions.py: removed unused 'field' import - model/tracing/__init__.py, model/wire/__init__.py: alphabetized imports Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep consolidated index.js import (F branch has the correct fix). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply ruff format to new files (core, tracing, streaming, wire model files) and corresponding test files. Resolves ruff format --check CI failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…issing TS model group exports - Rename hand-written exception class InvokerError -> InvokerNotFoundException in InvokerRegistry.cs to avoid collision with generated TypeSpec DTO InvokerError (partial class) - Rename Key property to InvokerKey and update 4 throw sites - Update PipelineTests.cs: Assert.Throws<InvokerNotFoundException> and ex.InvokerKey - Add missing wire/streaming/tracing group exports to TypeScript model/index.ts - Add missing core group members (FileNotFoundError, InvokerError, ValidationError, ValidationResult) to model/core/index.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… fix docs and C# examples - Add AnthropicWireMessage and all wire types to Python model/__init__.py - Add StreamOptions to Python model/__init__.py - Add TraceFile, TraceSpan, TraceTime to Python model/__init__.py - Fix docs reference/index.md slug: 'reference/index' -> 'reference' to fix broken /reference/ links - Fix C# docs examples: Pipeline.ParseAsync now requires context parameter (pass null) - Fix C# docs examples: Message.Role is now Role enum, not string; use Role.System/Role.User Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
xUnit runs test classes in parallel by default. PromptyLoadsTests and ChatTests both mutate OPENAI_API_KEY, causing ChatBasic_InvokeAsync_With MockedExecutor to race and see a null env var. Adding [Collection] serializes the two classes without changing logic. Also commit the ruff isort fix for model/__init__.py (I001). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds missing TypeSpec model definitions for types specified in
spec/spec.mdbut not yet modeled in TypeSpec. All new types include@docannotations and@sampleexamples matching the spec.New Type Files
schema/model/core/errors.tspInvokerError,ValidationError,FileNotFoundErrorschema/model/tracing/tracer.tspTraceValue,TraceTime,TraceSpan,TraceFileschema/model/streaming/stream.tspStreamOptionsschema/model/core/validation.tspValidationResultschema/model/wire/anthropic-types.tspGenerated Output
All emitters ran successfully, generating code for:
Notes
anthropic-types.tspis separate fromanthropic.tspbecause TypeSpec'susing/augment syntax (used in anthropic.tsp for@@knownAsmappings) conflicts withnamespacemodel declarationsTraceSpan.__frames,TraceValuecollections) useunknownto work around a recursion limitation in the prompty-emittercargo fmtstep fails on generated Rust code due to a pre-existing emitter bug with thetypekeyword — not introduced by this PR