From 63d9f23ff5978b58b67723f460b6e6eb7f67754c Mon Sep 17 00:00:00 2001 From: windsonsea Date: Thu, 23 Jan 2025 10:08:30 +0800 Subject: [PATCH] [en] update en text in models/service.md --- .github/labeler.yml | 2 +- docs/zh/docs/en/models/service.md | 77 ++++++++++++++++++------------- 2 files changed, 45 insertions(+), 34 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 100faa3..6e063c5 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -14,7 +14,7 @@ dev: - "scripts/**/*" - ".github/**/*" -dmc: +models: - "docs/zh/docs/models/**/*" - "docs/zh/docs/en/models/**/*" diff --git a/docs/zh/docs/en/models/service.md b/docs/zh/docs/en/models/service.md index c753aba..8337c09 100644 --- a/docs/zh/docs/en/models/service.md +++ b/docs/zh/docs/en/models/service.md @@ -1,33 +1,45 @@ # Model Services -Model services are a solution for quickly deploying open-source or fine-tuned large language models as callable services. With one-click deployment, the complex management of models is simplified into a standardized service format, compatible with mainstream model service API call capabilities, meeting the demand for immediate use. +Model services provide a solution for quickly deploying open-source or fine-tuned large language models +as callable services. With one-click deployment, the complex management of models is simplified into a +standardized service format. This format is compatible with mainstream model service API call capabilities, +enabling immediate use. -- Model services allow users to call selected models to perform tasks such as text generation, chat processing, image generation, etc. -- Supports online experience of models. +- Model services allow users to call selected models to perform tasks such as text generation, + chat processing, image generation, and more. +- These services support the online experience of models. -The details of the model service include basic information about the service, authorization methods, and call examples. +The details of the model service include basic information about the service, available +authorization methods, and example API calls. ## Basic Information -- Model Service Name: The name of the current service, used to identify this model service. -- Access Path Name: Each model service has a unique path name. -- Model Type: The model being used by the current service. -- Status: The current status of the service. -- Billing Method: The billing method for the current service. +- **Model Service Name:** The name of the service, used to identify this model service. +- **Access Path Name:** A unique path name for each model service. +- **Model Type:** The type of model used by the service. +- **Status:** The current operational status of the service. +- **Billing Method:** The billing method for the service. ## Authorization Methods -- API-Key Authorization: +### API-Key Authorization - - All API requests need to include an Authorization field in the HTTP Header for identity verification. - - Format: Authorization: Bearer {API_KEY} - - You can obtain the key through the "View My API-Key" link on the page. +- All API requests require the inclusion of an `Authorization` field in the HTTP header for identity verification. +- Format: `Authorization: Bearer {API_KEY}` +- You can obtain your API key by clicking the "View My API-Key" link on the page. -- Security Advice: Store the API-Key on the backend server to avoid exposing the key in client-side code and prevent leakage. +### Security Advice + +- Store the API key securely on the backend server to prevent exposure in client-side code + and avoid potential security leaks. ## API Call Example -- Request URL: The POST request URL is `https://sh-02.d.run/v1/chat/completions` +### Request URL + +The POST request URL is: + +`https://sh-02.d.run/v1/chat/completions` ### Request Example: Calling the API with curl @@ -42,16 +54,17 @@ curl 'https://sh-02.d.run/v1/chat/completions' \ }' ``` -Parameter Explanation: +**Request Parameters:** -- model: The access path name of the model service (e.g., u-8105f7322477/test). -- messages: A list of chat history containing user input, for example: +- **model:** The access path name of the model service (e.g., `u-8105f7322477/test`). +- **messages:** A list of chat history containing user input, for example: ```json [{"role": "user", "content": "Say this is a test!"}] ``` -- temperature: Controls the randomness of the generated results; a higher value results in more creative outputs, while a lower value yields more stable outputs. +- **temperature:** Controls the randomness of the generated output. A higher value produces + more creative results, while a lower value yields more stable outputs. ### Response Example @@ -79,21 +92,19 @@ Parameter Explanation: } ``` -Response Field Explanation: - -- id: A unique identifier for the generated result. -- model: The ID of the model service being called. -- choices: An array of results generated by the model. - - message: The generated content. - - content: The text content generated by the model. -- usage: Token usage for this call: - - prompt_tokens: The number of tokens for user input. - - completion_tokens: The number of tokens for the generated result. - - total_tokens: The total usage. +**Response Fields:** -- Integration Development Examples +- **id:** A unique identifier for the generated result. +- **model:** The ID of the model service being called. +- **choices:** An array of results generated by the model. + - **message:** The generated content. + - **content:** The text content produced by the model. +- **usage:** Token usage for this call: + - **prompt_tokens:** The number of tokens used for the user input. + - **completion_tokens:** The number of tokens used for the generated response. + - **total_tokens:** The total token usage. -### Python Example Code +### Python Example ```python # Compatible with OpenAI Python library v1.0.0 and above @@ -120,7 +131,7 @@ content = response.choices[0].message.content print(content) ``` -### Node.js Example Code +### Node.js Example ```js const OpenAI = require('openai');