Skip to content

Commit

Permalink
OPIK-546: Update create chat completions spec and SDKs (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrescrz authored Dec 16, 2024
1 parent ab6d79c commit 4e02d4e
Show file tree
Hide file tree
Showing 76 changed files with 527 additions and 128 deletions.
64 changes: 60 additions & 4 deletions apps/opik-documentation/documentation/rest_api/opik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ paths:
post:
tags:
- Chat Completions
summary: Get chat completions
description: Get chat completions
operationId: getChatCompletions
summary: Create chat completions
description: Create chat completions
operationId: createChatCompletions
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionRequest'
responses:
"501":
"200":
description: Chat completions response
content:
text/event-stream:
Expand Down Expand Up @@ -3785,6 +3785,8 @@ components:
items:
type: string
ProviderApiKey_Public:
required:
- provider
type: object
properties:
id:
Expand Down Expand Up @@ -3812,6 +3814,7 @@ components:
ProviderApiKey:
required:
- api_key
- provider
type: object
properties:
id:
Expand Down Expand Up @@ -3841,6 +3844,7 @@ components:
ProviderApiKey_Write:
required:
- api_key
- provider
type: object
properties:
provider:
Expand Down Expand Up @@ -4291,6 +4295,18 @@ components:
description:
pattern: (?s)^\s*(\S.*\S|\S)\s*$
type: string
ErrorInfo:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
Span:
required:
- name
Expand Down Expand Up @@ -4350,6 +4366,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo'
created_at:
type: string
format: date-time
Expand All @@ -4372,6 +4390,18 @@ components:
total_estimated_cost:
type: number
readOnly: true
ErrorInfo_Write:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
Span_Write:
required:
- name
Expand Down Expand Up @@ -4427,6 +4457,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo_Write'
SpanBatch:
required:
- spans
Expand Down Expand Up @@ -4456,6 +4488,18 @@ components:
properties:
name:
type: string
ErrorInfo_Public:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
FeedbackScore_Public:
required:
- name
Expand Down Expand Up @@ -4550,6 +4594,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo_Public'
created_at:
type: string
format: date-time
Expand Down Expand Up @@ -4733,6 +4779,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo'
Trace:
required:
- name
Expand Down Expand Up @@ -4769,6 +4817,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo'
usage:
type: object
additionalProperties:
Expand Down Expand Up @@ -4830,6 +4880,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo_Write'
TraceBatch:
required:
- traces
Expand Down Expand Up @@ -4884,6 +4936,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo_Public'
usage:
type: object
additionalProperties:
Expand Down Expand Up @@ -4955,3 +5009,5 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo'
64 changes: 60 additions & 4 deletions sdks/code_generation/fern/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ paths:
post:
tags:
- Chat Completions
summary: Get chat completions
description: Get chat completions
operationId: getChatCompletions
summary: Create chat completions
description: Create chat completions
operationId: createChatCompletions
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionRequest'
responses:
"501":
"200":
description: Chat completions response
content:
text/event-stream:
Expand Down Expand Up @@ -3785,6 +3785,8 @@ components:
items:
type: string
ProviderApiKey_Public:
required:
- provider
type: object
properties:
id:
Expand Down Expand Up @@ -3812,6 +3814,7 @@ components:
ProviderApiKey:
required:
- api_key
- provider
type: object
properties:
id:
Expand Down Expand Up @@ -3841,6 +3844,7 @@ components:
ProviderApiKey_Write:
required:
- api_key
- provider
type: object
properties:
provider:
Expand Down Expand Up @@ -4291,6 +4295,18 @@ components:
description:
pattern: (?s)^\s*(\S.*\S|\S)\s*$
type: string
ErrorInfo:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
Span:
required:
- name
Expand Down Expand Up @@ -4350,6 +4366,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo'
created_at:
type: string
format: date-time
Expand All @@ -4372,6 +4390,18 @@ components:
total_estimated_cost:
type: number
readOnly: true
ErrorInfo_Write:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
Span_Write:
required:
- name
Expand Down Expand Up @@ -4427,6 +4457,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo_Write'
SpanBatch:
required:
- spans
Expand Down Expand Up @@ -4456,6 +4488,18 @@ components:
properties:
name:
type: string
ErrorInfo_Public:
required:
- exception_type
- traceback
type: object
properties:
exception_type:
type: string
message:
type: string
traceback:
type: string
FeedbackScore_Public:
required:
- name
Expand Down Expand Up @@ -4550,6 +4594,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo_Public'
created_at:
type: string
format: date-time
Expand Down Expand Up @@ -4733,6 +4779,8 @@ components:
additionalProperties:
type: integer
format: int32
error_info:
$ref: '#/components/schemas/ErrorInfo'
Trace:
required:
- name
Expand Down Expand Up @@ -4769,6 +4817,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo'
usage:
type: object
additionalProperties:
Expand Down Expand Up @@ -4830,6 +4880,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo_Write'
TraceBatch:
required:
- traces
Expand Down Expand Up @@ -4884,6 +4936,8 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo_Public'
usage:
type: object
additionalProperties:
Expand Down Expand Up @@ -4955,3 +5009,5 @@ components:
type: array
items:
type: string
error_info:
$ref: '#/components/schemas/ErrorInfo'
8 changes: 6 additions & 2 deletions sdks/python/src/opik/rest_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
DeleteFeedbackScore,
Delta,
DeltaRole,
ErrorInfo,
ErrorInfoPublic,
ErrorInfoWrite,
ErrorMessage,
ErrorMessageDetail,
ErrorMessagePublic,
Expand Down Expand Up @@ -92,7 +95,6 @@
JsonSchema,
JsonSchemaElement,
Message,
NotImplementedErrorBodyItem,
NumericalFeedbackDefinition,
NumericalFeedbackDefinitionCreate,
NumericalFeedbackDefinitionPublic,
Expand Down Expand Up @@ -235,6 +237,9 @@
"DeleteFeedbackScore",
"Delta",
"DeltaRole",
"ErrorInfo",
"ErrorInfoPublic",
"ErrorInfoWrite",
"ErrorMessage",
"ErrorMessageDetail",
"ErrorMessagePublic",
Expand Down Expand Up @@ -288,7 +293,6 @@
"Message",
"NotFoundError",
"NotImplementedError",
"NotImplementedErrorBodyItem",
"NumericalFeedbackDefinition",
"NumericalFeedbackDefinitionCreate",
"NumericalFeedbackDefinitionPublic",
Expand Down
Loading

0 comments on commit 4e02d4e

Please sign in to comment.