@@ -918,7 +918,7 @@ paths:
918918 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"
919919 - sdk: curl
920920 name: Default
921- 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 }'"
921+ 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 "
922922 request:
923923 model: command-r
924924 messages:
@@ -1092,7 +1092,7 @@ paths:
10921092 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"
10931093 - sdk: curl
10941094 name: Streaming
1095- 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 }'"
1095+ 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 "
10961096 request:
10971097 model: command-r
10981098 messages:
@@ -10908,7 +10908,7 @@ paths:
1090810908 readOnly: true
1090910909 last_used:
1091010910 type: string
10911- description: Timestamp for the latest request to this fine-tuned model.
10911+ description: 'Deprecated: Timestamp for the latest request to this fine-tuned model.'
1091210912 format: date-time
1091310913 readOnly: true
1091410914 required: true
@@ -16591,7 +16591,7 @@ components:
1659116591 readOnly: true
1659216592 last_used:
1659316593 type: string
16594- description: read-only. Timestamp for the latest request to this fine-tuned model.
16594+ description: ' read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.'
1659516595 format: date-time
1659616596 readOnly: true
1659716597 description: This resource represents a fine-tuned model.
0 commit comments