Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 19, 2024
1 parent d16789f commit 6e3d1a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/libs/Cohere/Generated/Cohere.Models.FinetunedModel.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public sealed partial class FinetunedModel
public global::System.DateTime? CompletedAt { get; set; }

/// <summary>
/// read-only. Timestamp for the latest request to this fine-tuned model.<br/>
/// read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.<br/>
/// Included only in responses
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("last_used")]
Expand Down Expand Up @@ -141,7 +141,7 @@ public sealed partial class FinetunedModel
/// Included only in responses
/// </param>
/// <param name="lastUsed">
/// read-only. Timestamp for the latest request to this fine-tuned model.<br/>
/// read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.<br/>
/// Included only in responses
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public sealed partial class UpdateFinetunedModelRequest
public global::System.DateTime? CompletedAt { get; set; }

/// <summary>
/// Timestamp for the latest request to this fine-tuned model.<br/>
/// Deprecated: Timestamp for the latest request to this fine-tuned model.<br/>
/// Included only in responses
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("last_used")]
Expand Down Expand Up @@ -130,7 +130,7 @@ public sealed partial class UpdateFinetunedModelRequest
/// Included only in responses
/// </param>
/// <param name="lastUsed">
/// Timestamp for the latest request to this fine-tuned model.<br/>
/// Deprecated: Timestamp for the latest request to this fine-tuned model.<br/>
/// Included only in responses
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
Expand Down
8 changes: 4 additions & 4 deletions src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ paths:
code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Default {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-r-plus-08-2024\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(UserMessageContent.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n System.out.println(response);\n }\n}\n"
- sdk: curl
name: Default
code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-r-plus-08-2024\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ],\n }'"
code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-r-plus-08-2024\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ]\n }'\n"
request:
model: command-r
messages:
Expand Down Expand Up @@ -1092,7 +1092,7 @@ paths:
code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatStreamRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Stream {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n Iterable<StreamedChatResponseV2> response =\n cohere\n .v2()\n .chatStream(\n V2ChatStreamRequest.builder()\n .model(\"command-r-plus-08-2024\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(UserMessageContent.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n for (StreamedChatResponseV2 chatResponse : response) {\n if (chatResponse.isContentDelta()) {\n System.out.println(\n chatResponse\n .getContentDelta()\n .flatMap(ChatContentDeltaEvent::getDelta)\n .flatMap(ChatContentDeltaEventDelta::getMessage)\n .flatMap(ChatContentDeltaEventDeltaMessage::getContent)\n .flatMap(ChatContentDeltaEventDeltaMessageContent::getText)\n .orElse(\"\"));\n }\n }\n\n System.out.println(response);\n }\n}\n"
- sdk: curl
name: Streaming
code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"stream\": true,\n \"model\": \"command-r-plus-08-2024\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ],\n }'"
code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"stream\": true,\n \"model\": \"command-r-plus-08-2024\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ]\n }'\n"
request:
model: command-r
messages:
Expand Down Expand Up @@ -10908,7 +10908,7 @@ paths:
readOnly: true
last_used:
type: string
description: Timestamp for the latest request to this fine-tuned model.
description: 'Deprecated: Timestamp for the latest request to this fine-tuned model.'
format: date-time
readOnly: true
required: true
Expand Down Expand Up @@ -16591,7 +16591,7 @@ components:
readOnly: true
last_used:
type: string
description: read-only. Timestamp for the latest request to this fine-tuned model.
description: 'read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.'
format: date-time
readOnly: true
description: This resource represents a fine-tuned model.
Expand Down

0 comments on commit 6e3d1a5

Please sign in to comment.