当前位置: 首页 > news >正文

Azure OpenAI Swagger Validation Failure with APIM

题意:Azure OpenAI Swagger 验证失败与 APIM

问题背景:

I'm converting the Swagger for Azure OpenAI API Version 2023-07-01-preview from json to yaml

我正在将 Azure OpenAI API 版本 2023-07-01-preview 的 Swagger 从 JSON 转换为 YAML。

My Swagger looks like this        我的 Swagger 看起来是这样的

openapi: 3.0.1
info:title: OpenAI Models APIdescription: ''version: '123'
servers:- url: https://def.com/openai
paths:/gpt-35-turbo/chat/completions:post:tags:- openaisummary: Creates a completion for the chat messagedescription: gpt-35-turbo-chat-completionoperationId: GPT_35_Turbo_ChatCompletions_CreaterequestBody:required: truecontent:application/json:schema:$ref: '#/components/schemas/createChatCompletionRequest'responses:'200':description: OKcontent:application/json:schema:$ref: '#/components/schemas/createChatCompletionResponse'headers:apim-request-id:description: Request ID for troubleshooting purposesschema:type: stringdefault:description: Service unavailablecontent:application/json:schema:$ref: '#/components/schemas/errorResponse'headers:apim-request-id:description: Request ID for troubleshooting purposesschema:type: string
components:schemas:errorResponse:type: objectproperties:error:$ref: '#/components/schemas/error'errorBase:type: objectproperties:code:type: stringmessage:type: stringerror:type: objectallOf:- $ref: '#/components/schemas/errorBase'properties:code:type: stringmessage:type: stringparam:type: stringtype:type: stringinner_error:$ref: '#/components/schemas/innerError'innerError:description: Inner error with additional details.type: objectproperties:code:$ref: '#/components/schemas/innerErrorCode'content_filter_results:$ref: '#/components/schemas/contentFilterResults'innerErrorCode:description: Error codes for the inner error object.enum:- ResponsibleAIPolicyViolationtype: stringx-ms-enum:name: InnerErrorCodemodelAsString: truevalues:- value: ResponsibleAIPolicyViolationdescription: The prompt violated one of more content filter rules.  contentFilterResult:type: objectproperties:severity:type: stringenum:- safe- low- medium- highx-ms-enum:name: ContentFilterSeveritymodelAsString: truevalues:- value: safedescription: >-General content or related content in generic or non-harmfulcontexts.- value: lowdescription: Harmful content at a low intensity and risk level.- value: mediumdescription: Harmful content at a medium intensity and risk level.- value: highdescription: Harmful content at a high intensity and risk level.filtered:type: booleanrequired:- severity- filteredcontentFilterResults:type: objectdescription: >-Information about the content filtering category (hate, sexual,violence, self_harm), if it has been detected, as well as the severitylevel (very_low, low, medium, high-scale that determines the intensityand risk level of harmful content) and if it has been filtered or not.properties:sexual:$ref: '#/components/schemas/contentFilterResult'violence:$ref: '#/components/schemas/contentFilterResult'hate:$ref: '#/components/schemas/contentFilterResult'self_harm:$ref: '#/components/schemas/contentFilterResult'error:$ref: '#/components/schemas/errorBase'promptFilterResult:type: objectdescription: Content filtering results for a single prompt in the request.properties:prompt_index:type: integercontent_filter_results:$ref: '#/components/schemas/contentFilterResults'promptFilterResults:type: arraydescription: >-Content filtering results for zero or more prompts in the request. In astreaming request, results for different prompts may arrive at differenttimes or in different orders.items:$ref: '#/components/schemas/promptFilterResult'  createChatCompletionRequest:type: objectallOf:- $ref: '#/components/schemas/chatCompletionsRequestCommon'- properties:messages:description: >-A list of messages comprising the conversation so far. [ExamplePythoncode](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb).type: arrayminItems: 1items:$ref: '#/components/schemas/chatCompletionRequestMessage'functions:description: A list of functions the model may generate JSON inputs for.type: arrayminItems: 1items:$ref: '#/components/schemas/chatCompletionFunctions'function_call:description: >-Controls how the model responds to function calls. "none" meansthe model does not call a function, and responds to theend-user. "auto" means the model can pick between an end-user orcalling a function.  Specifying a particular function via`{"name":\ "my_function"}` forces the model to call thatfunction. "none" is the default when no functions are present."auto" is the default if functions are present.oneOf:- type: stringenum:- none- auto- type: objectproperties:name:type: stringdescription: The name of the function to call.required:- name'n':type: integerminimum: 1maximum: 128default: 1example: 1nullable: truedescription: >-How many chat completion choices to generate for each inputmessage.required:- messages    chatCompletionsRequestCommon:type: objectproperties:temperature:description: >-What sampling temperature to use, between 0 and 2. Higher valueslike 0.8 will make the output more random, while lower values like0.2 will make it more focused and deterministic.We generally recommend altering this or `top_p` but not both.type: numberminimum: 0maximum: 2default: 1example: 1nullable: truetop_p:description: >-An alternative to sampling with temperature, called nucleussampling, where the model considers the results of the tokens withtop_p probability mass. So 0.1 means only the tokens comprising thetop 10% probability mass are considered.We generally recommend altering this or `temperature` but not both.type: numberminimum: 0maximum: 1default: 1example: 1nullable: truestop:description: Up to 4 sequences where the API will stop generating further tokens.oneOf:- type: stringnullable: true- type: arrayitems:type: stringnullable: falseminItems: 1maxItems: 4description: Array minimum size of 1 and maximum of 4default: nullmax_tokens:description: >-The maximum number of tokens allowed for the generated answer. Bydefault, the number of tokens the model can return will be (4096 -prompt tokens).type: integerdefault: 4096presence_penalty:description: >-Number between -2.0 and 2.0. Positive values penalize new tokensbased on whether they appear in the text so far, increasing themodel's likelihood to talk about new topics.type: numberdefault: 0minimum: -2maximum: 2frequency_penalty:description: >-Number between -2.0 and 2.0. Positive values penalize new tokensbased on their existing frequency in the text so far, decreasing themodel's likelihood to repeat the same line verbatim.type: numberdefault: 0minimum: -2maximum: 2logit_bias:description: >-Modify the likelihood of specified tokens appearing in thecompletion. Accepts a json object that maps tokens (specified bytheir token ID in the tokenizer) to an associated bias value from-100 to 100. Mathematically, the bias is added to the logitsgenerated by the model prior to sampling. The exact effect will varyper model, but values between -1 and 1 should decrease or increaselikelihood of selection; values like -100 or 100 should result in aban or exclusive selection of the relevant token.type: objectnullable: trueuser:description: >-A unique identifier representing your end-user, which can help AzureOpenAI to monitor and detect abuse.type: stringexample: user-1234nullable: falsechatCompletionRequestMessage:type: objectproperties:role:type: stringenum:- system- user- assistant- functiondescription: >-The role of the messages author. One of `system`, `user`,`assistant`, or `function`.content:type: stringdescription: >-The contents of the message. `content` is required for all messagesexcept assistant messages with function calls.name:type: stringdescription: >-The name of the author of this message. `name` is required if roleis `function`, and it should be the name of the function whoseresponse is in the `content`. May contain a-z, A-Z, 0-9, andunderscores, with a maximum length of 64 characters.function_call:type: objectdescription: >-The name and arguments of a function that should be called, asgenerated by the model.properties:name:type: stringdescription: The name of the function to call.arguments:type: stringdescription: >-The arguments to call the function with, as generated by themodel in JSON format. Note that the model does not alwaysgenerate valid JSON, and may hallucinate parameters not definedby your function schema. Validate the arguments in your codebefore calling your function.required:- rolecreateChatCompletionResponse:type: objectallOf:- $ref: '#/components/schemas/chatCompletionsResponseCommon'- properties:prompt_filter_results:$ref: '#/components/schemas/promptFilterResults'choices:type: arrayitems:type: objectallOf:- $ref: '#/components/schemas/chatCompletionChoiceCommon'- properties:message:$ref: '#/components/schemas/chatCompletionResponseMessage'content_filter_results:$ref: '#/components/schemas/contentFilterResults'required:- id- object- created- model- choices                chatCompletionFunctions:type: objectproperties:name:type: stringdescription: >-The name of the function to be called. Must be a-z, A-Z, 0-9, orcontain underscores and dashes, with a maximum length of 64.description:type: stringdescription: The description of what the function does.parameters:$ref: '#/components/schemas/chatCompletionFunctionParameters'required:- namechatCompletionFunctionParameters:type: objectdescription: >-The parameters the functions accepts, described as a JSON Schema object.See the [guide](/docs/guides/gpt/function-calling) for examples, and the[JSON Schemareference](https://json-schema.org/understanding-json-schema/) fordocumentation about the format.additionalProperties: truechatCompletionsResponseCommon:type: objectproperties:id:type: stringobject:type: stringcreated:type: integerformat: unixtimemodel:type: stringusage:type: objectproperties:prompt_tokens:type: integercompletion_tokens:type: integertotal_tokens:type: integerrequired:- prompt_tokens- completion_tokens- total_tokensrequired:- id- object- created- modelchatCompletionChoiceCommon:type: objectproperties:index:type: integerfinish_reason:type: stringchatCompletionResponseMessage:type: objectproperties:role:type: stringenum:- system- user- assistant- functiondescription: The role of the author of this message.content:type: stringdescription: The contents of the message.function_call:type: objectdescription: >-The name and arguments of a function that should be called, asgenerated by the model.properties:name:type: stringdescription: The name of the function to call.arguments:type: stringdescription: >-The arguments to call the function with, as generated by themodel in JSON format. Note that the model does not alwaysgenerate valid JSON, and may hallucinate parameters not definedby your function schema. Validate the arguments in your codebefore calling your function.required:- role          securitySchemes:apiKeyHeader:type: apiKeyname: Ocp-Apim-Subscription-Keyin: headerapiKeyQuery:type: apiKeyname: subscription-keyin: query
security:- apiKeyHeader: [ ]- apiKeyQuery: [ ]

I used this in azure apim and validating the content like this

我在 Azure APIM 中使用了这个,并像这样验证内容。

<validate-content unspecified-content-type-action="ignore" max-size="102400" size-exceeded-action="detect" errors-variable-name="requestBodyValidation"><content type="application/json" validate-as="json" action="prevent" allow-additional-properties="false" /></validate-content>

Now I tried to give the request like the actual property

现在我尝试像实际属性一样提供请求。

{"messages": [{"role": "user", "content": "Find beachfront hotels in San Diego for less than $300 a month with free breakfast."}],"temperature": 1,"top_p": 1,"stop": "","max_tokens": 2000,"presence_penalty": 0,"frequency_penalty": 0,"logit_bias": {},"user": "user-1234","n": 1,"function_call" : "auto","functions" : [{"name": "search_hotels","description": "Retrieves hotels from the search index based on the parameters provided","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The location of the hotel (i.e. Seattle, WA)"},"max_price": {"type": "number","description": "The maximum price for the hotel"},"features": {"type": "string","description": "A comma separated list of features (i.e. beachfront, free wifi, etc.)"}},"required": ["location"]}}]
}

And the APIM is giving the error like

而 APIM 给出了如下错误:

{"statusCode": 400,"message": "Body of the request does not conform to the definition which is associated with the content type application/json. JSON does not match all schemas from 'allOf'. Invalid schema indexes: 0, 1. Line: 42, Position: 1"
}

But the same request is working when I directly hit the azure openai.

但当我直接请求 Azure OpenAI 时,同样的请求是有效的。

What could be the possible issue here ?

这里可能是什么问题?

问题解决:

I believe your problem is this line allow-additional-properties="false"

我认为你遇到的问题是这一行 allow-additional-properties="false"

allow-additional-properties Boolean. For a JSON schema, specifies whether to implement a runtime override of the additionalProperties value configured in the schema:

  • true: allow additional properties in the request or response body, even if the JSON schema's additionalProperties field is configured to not allow additional properties.

true:允许在请求或响应主体中添加额外的属性,即使 JSON 模式的 additionalProperties 字段配置为不允许额外属性。

  • false: do not allow additional properties in the request or response body, even if the JSON schema's additionalProperties field is configured to allow additional properties

false:不允许在请求或响应主体中添加额外的属性,即使 JSON 模式的 additionalProperties 字段配置为允许额外属性。

If the attribute isn't specified, the policy validates additional properties according to configuration of the additionalProperties field in the schema.

如果未指定该属性,则策略将根据模式中 additionalProperties 字段的配置来验证额外属性。

source:    来源        https://learn.microsoft.com/en-us/azure/api-management/validate-content-policy#content-attributes

This property overrides your JSON Schema. Even though your allOf definition does not use additionalProperties: false, apim will inject this constraint to the root schema, which translates to

此属性会覆盖你的 JSON Schema。即使你的 allOf 定义没有使用 additionalProperties: false,APIM 仍会将此约束注入到根模式中,这会转化为

{"type": "object","additionalProperties": false,"allOf": [{...}, {...}]
}

This schema doesn't allow any properties to be validated because no properties are defined at the root.

该模式不允许验证任何属性,因为根本没有定义属性。

The only valid schemas in this situation would be

在这种情况下,唯一有效的模式是

{}ORtrue

There are a few ways to tackle this but IMHO, the best option is to use the schema definition, rather than the apim attribute because you're introducing constraints on the schema where they are not defined. If someone else were to review the schema, they would run into the same issue you are having.

解决这个问题有几种方法,但依我看来,最好的选择是使用模式定义,而不是使用 APIM 属性,因为你在模式中引入了未定义的约束。如果其他人来审查这个模式,他们也会遇到你现在面临的相同问题。

This is where it may get tricky for you depending on which version of JSON Schema is supported in APIM and which version you are using.

这可能会变得棘手,具体取决于 APIM 支持的 JSON Schema 版本以及你正在使用的版本。

Draft-04 - 07 requires some massaging to the schema, in most circumstances, to achieve the desired behavior of using allOf with additionalProperties": false

在大多数情况下,Draft-04 到 Draft-07 需要对模式进行一些调整,以实现使用 allOfadditionalProperties: false 的预期行为。

  • turn off the content attribute in your apim validation

在你的 APIM 验证中关闭 content 属性。

  • add all properties of the first depth of subschemas to the root with an empty schema. This will allow the validator to recognize those properties at the root level to satisfy additionalProperties

将所有子模式第一层的属性添加到根模式中,并使用一个空模式。这将允许验证器在根级别识别这些属性,以满足 additionalProperties 的要求。

{"$schema": "http://json-schema.org/draft-07/schema#","type": "object","additionalProperties": false,"properties": {"messages": {},"temperature": {},"top_p": {},"stop": {},"max_tokens": {},"presence_penalty": {},"frequency_penalty": {},"logit_bias": {},"user": { },"n": { },"function_call": { },"functions": { }},"allOf": [{"type": "object","properties": {"temperature": {},"top_p": {},"stop": {},"max_tokens": {},"presence_penalty": {},"frequency_penalty": {},"logit_bias": {},"user": {}}},{"type": "object","properties": {"messages": {},"n": {},"function_call": {},"functions": {}}}]
}

If you're using JSON Schema draft 2019-09 or later, you can use the newer keyword unevaluatedProperties which performs the behavior described above, automatically.

如果你使用的是 JSON Schema draft 2019-09 或更高版本,你可以使用较新的关键字 unevaluatedProperties,它会自动执行上述描述的行为。

{"$schema": "https://json-schema.org/draft/2019-09/schema","type": "object","unevaluatedProperties": false,"allOf": [{"type": "object","properties": {"temperature": {},"top_p": {},"stop": {},"max_tokens": {},"presence_penalty": {},"frequency_penalty": {},"logit_bias": {},"user": {}}},{"type": "object","properties": {"messages": {},"n": {},"function_call": {},"functions": {}}}]
}

This example fails:        这个示例失败了

{"messages": [{"role": "user", "content": "Find beachfront hotels in San Diego for less than $300 a month with free breakfast."}],"stackOverflow": -1
}
Invalid# fails schema constraint https://json-schema.hyperjump.io/schema#/unevaluatedProperties#/stackOverflow fails schema constraint https://json-schema.hyperjump.io/schema#/unevaluatedProperties

 

相关文章:

Azure OpenAI Swagger Validation Failure with APIM

题意&#xff1a;Azure OpenAI Swagger 验证失败与 APIM 问题背景&#xff1a; Im converting the Swagger for Azure OpenAI API Version 2023-07-01-preview from json to yaml 我正在将 Azure OpenAI API 版本 2023-07-01-preview 的 Swagger 从 JSON 转换为 YAML。 My S…...

haproxy高级功能配置

介绍HAProxy高级配置及实用案例 一.基于cookie会话保持 cookie value:为当前server指定cookie值&#xff0c;实现基于cookie的会话黏性&#xff0c;相对于基于 source 地址hash 调度算法对客户端的粒度更精准&#xff0c;但同时也加大了haproxy负载&#xff0c;目前此模式使用…...

XXL-JOB分布式定时任务框架快速入门

文章目录 前言定时任务分布式任务调度 1、XXL-JOB介绍1.1 XXL-JOB概述1.2 XXL-JOB特性1.3 整体架构 2、XXL-JOB任务中心环境搭建2.1 XXL-JOB源码下载2.2 IDEA导入xxljob工程2.3 初始化数据库2.4 Docker安装任务管理中心 3、XXL-JOB任务注册测试3.1 引入xxl-job核心依赖3.2 配置…...

直流电机及其驱动

直流电机是一种将电能转换为机械能的装置&#xff0c;有两个电极&#xff0c;当电极正接时&#xff0c;电机正转&#xff0c;当电极反接时&#xff0c;电机反转。 直流电机属于大功率器件&#xff0c;GPIO口无法直接驱动&#xff0c;需要配合电机驱动电路来操作 TB6612是一款双…...

Java-判断一个字符串是否为有效的JSON字符串

在 Java 中判断一个字符串是否为有效的 JSON 字符串&#xff0c;可以使用不同的库来进行验证。常见的库 包括 org.json、com.google.gson 和 com.alibaba.fastjson 等。这里我将展示如何使用 com.alibaba.fastjson 库来实现一个简单的工具类&#xff0c;用于判断给定的字符串…...

FPGA开发板的基本知识及应用

FPGA开发板是一种专门设计用于开发和测试现场可编程门阵列(Field-Programmable Gate Array, FPGA)的硬件平台。FPGA是一种高度可配置的集成电路&#xff0c;能够在制造后被编程以执行各种数字逻辑功能。FPGA开发板通常包含一个FPGA芯片以及一系列支持电路和接口&#xff0c;以便…...

JVM知识总结(性能调优)

文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 文章收录在网站&#xff1a;http://hardyfish.top/ 性能调优 何时进行JVM调优&#xff1f; 遇到以下情况&#xff0c…...

基于Ascend C的Matmul算子性能优化最佳实践

矩阵乘法是深度学习计算中的基础操作&#xff0c;对于提升模型训练和推理速度至关重要。昇腾AI处理器是一款专门面向AI领域的AI加速器&#xff0c;其AI Core采用达芬奇架构&#xff0c;以高性能Cube计算引擎为基础&#xff0c;针对矩阵运算进行加速&#xff0c;可大幅提高单位面…...

SQL注入之EVAL长度限制突破技巧

要求&#xff1a; PHP Eval函数参数限制在16个字符的情况下 &#xff0c;如何拿到Webshell&#xff1f; widows小皮环境搭建&#xff1a; 使用phpstudy搭建一个网站。 随后在该eval文件夹下创建一个webshell.php文件&#xff0c;并在其输入代码环境 解题思路&#xff1a; 通…...

稀疏注意力:时间序列预测的局部性和Transformer的存储瓶颈

时间序列预测是许多领域的重要问题&#xff0c;包括对太阳能发电厂发电量、电力消耗和交通拥堵情况的预测。在本文中&#xff0c;提出用Transformer来解决这类预测问题。虽然在我们的初步研究中对其性能印象深刻&#xff0c;但发现了它的两个主要缺点:(1)位置不可知性:规范Tran…...

详谈系统中的环境变量

目录 前言1. 指令背后的本质2. 环境变量背后的本质3. 环境变量到底是什么4. 命令行参数5. 本地变量 与 内置命令6. 环境变量的相关命令 前言 相信在 it 行业学习或者工作的小伙伴们&#xff0c;基本都配置过环境变量&#xff08;windows环境下&#xff09;&#xff0c;如果你也…...

RAG与LLM原理及实践(11)--- Milvus hybrid search 源码分析及思想

目录 背景 hybrid search 源码分析 WeightedRanker 源码 hybrid search 核心 参数详解 基本入参 扩展入参 aysnc方式代码调用案例 说明 源码逻辑 prepare 调用过程 stub 调用结果 stub 调用过程 blocking 与 async 调用方式 深入内部core weightedRanker 的ch…...

JavaScript模拟空调效果

JavaScript模拟空调效果https://www.bootstrapmb.com/item/15074 在JavaScript中模拟空调效果主要依赖于前端界面的交互和状态变化&#xff0c;因为实际的温度调节、风扇速度调整等硬件操作无法直接通过JavaScript在浏览器中实现。不过&#xff0c;我们可以通过JavaScript来模…...

14.2 Pandas数据处理

欢迎来到我的博客,很高兴能够在这里和您见面!欢迎订阅相关专栏: 工💗重💗hao💗:野老杂谈 ⭐️ 全网最全IT互联网公司面试宝典:收集整理全网各大IT互联网公司技术、项目、HR面试真题. ⭐️ AIGC时代的创新与未来:详细讲解AIGC的概念、核心技术、应用领域等内容。 ⭐…...

python学习7---多进程

一、介绍 多进程是指在同一程序中创建多个独立的进程来执行任务。每个进程都有自己独立的内存空间&#xff0c;相互之间不干扰。 因为GIL锁的存在&#xff0c;对于CPU密集型任务&#xff08;例如计算密集型操作&#xff09;&#xff0c;使用多进程可以提高程序的效率。 优点&am…...

基于Spring + Vue的旅游景区项目+源代码+文档说明

文章目录 源代码下载地址项目介绍项目功能界面预览 项目备注源代码下载地址 源代码下载地址 点击这里下载源码 项目介绍 基于Spring Vue的旅游景区项目 项目功能 民宿管理员&#xff1a;订单数量统计&#xff0c;订单交易额统计&#xff0c;客房统计饼图&#xff0c;酒店…...

Java后端面试题

Redis缓存穿透、雪崩、击穿&#xff0c;布隆过滤器 一致性hash 一致性hash sharding-jdbc实现一致性hash #一致性hash, 应用在mysql数据库的分库分表上&#xff0c; 现在已经完成了分库分表&#xff0c; 现在的问题出现了&#xff0c; 需要继续新增数据库节点&#xff0c; 请…...

【Git】远程仓库新建分支后,拉到本地开发

1. 在远程仓库上创建分支 2. git fetch origin&#xff1a;在本地同步远程仓库的分支&#xff08;获取远程仓库所有分支的所有修改&#xff09; 3. git remote -a&#xff1a;查看所有分支&#xff08;远程&#xff0b;本地&#xff09; 4. git checkout -b 本地名 远程仓库…...

React H5设置企业级v6版本路由的配置

路由配置是项目开发的必要一环&#xff0c;尤其是目前流行SPA&#xff0c;下面看看如何使用v6版本路由进行合理的H5路由配置 一、基本页面结构&#xff08;目录根据开发要求建&#xff0c;下面仅用于展示配置路由&#xff09; 二、具体文件实现 1. index.tsx import React f…...

【微信小程序】全局配置

1. 全局配置文件及常用的配置项 2.window (1).小程序窗口的组成部分 (2). 了解 window 节点常用的配置项 (3). 设置导航栏的标题 (4). 设置导航栏的背景色 (5). 设置导航栏的标题颜色 (6). 全局开启下拉刷新功能 (7). 设置下拉刷新时窗口的背景色 (8).设置下拉刷新时 loading …...

springboot 百货中心供应链管理系统小程序

一、前言 随着我国经济迅速发展&#xff0c;人们对手机的需求越来越大&#xff0c;各种手机软件也都在被广泛应用&#xff0c;但是对于手机进行数据信息管理&#xff0c;对于手机的各种软件也是备受用户的喜爱&#xff0c;百货中心供应链管理系统被用户普遍使用&#xff0c;为方…...

智慧医疗能源事业线深度画像分析(上)

引言 医疗行业作为现代社会的关键基础设施,其能源消耗与环境影响正日益受到关注。随着全球"双碳"目标的推进和可持续发展理念的深入,智慧医疗能源事业线应运而生,致力于通过创新技术与管理方案,重构医疗领域的能源使用模式。这一事业线融合了能源管理、可持续发…...

云计算——弹性云计算器(ECS)

弹性云服务器&#xff1a;ECS 概述 云计算重构了ICT系统&#xff0c;云计算平台厂商推出使得厂家能够主要关注应用管理而非平台管理的云平台&#xff0c;包含如下主要概念。 ECS&#xff08;Elastic Cloud Server&#xff09;&#xff1a;即弹性云服务器&#xff0c;是云计算…...

React hook之useRef

React useRef 详解 useRef 是 React 提供的一个 Hook&#xff0c;用于在函数组件中创建可变的引用对象。它在 React 开发中有多种重要用途&#xff0c;下面我将全面详细地介绍它的特性和用法。 基本概念 1. 创建 ref const refContainer useRef(initialValue);initialValu…...

SciencePlots——绘制论文中的图片

文章目录 安装一、风格二、1 资源 安装 # 安装最新版 pip install githttps://github.com/garrettj403/SciencePlots.git# 安装稳定版 pip install SciencePlots一、风格 简单好用的深度学习论文绘图专用工具包–Science Plot 二、 1 资源 论文绘图神器来了&#xff1a;一行…...

安宝特方案丨XRSOP人员作业标准化管理平台:AR智慧点检验收套件

在选煤厂、化工厂、钢铁厂等过程生产型企业&#xff0c;其生产设备的运行效率和非计划停机对工业制造效益有较大影响。 随着企业自动化和智能化建设的推进&#xff0c;需提前预防假检、错检、漏检&#xff0c;推动智慧生产运维系统数据的流动和现场赋能应用。同时&#xff0c;…...

使用分级同态加密防御梯度泄漏

抽象 联邦学习 &#xff08;FL&#xff09; 支持跨分布式客户端进行协作模型训练&#xff0c;而无需共享原始数据&#xff0c;这使其成为在互联和自动驾驶汽车 &#xff08;CAV&#xff09; 等领域保护隐私的机器学习的一种很有前途的方法。然而&#xff0c;最近的研究表明&…...

dedecms 织梦自定义表单留言增加ajax验证码功能

增加ajax功能模块&#xff0c;用户不点击提交按钮&#xff0c;只要输入框失去焦点&#xff0c;就会提前提示验证码是否正确。 一&#xff0c;模板上增加验证码 <input name"vdcode"id"vdcode" placeholder"请输入验证码" type"text&quo…...

unix/linux,sudo,其发展历程详细时间线、由来、历史背景

sudo 的诞生和演化,本身就是一部 Unix/Linux 系统管理哲学变迁的微缩史。来,让我们拨开时间的迷雾,一同探寻 sudo 那波澜壮阔(也颇为实用主义)的发展历程。 历史背景:su的时代与困境 ( 20 世纪 70 年代 - 80 年代初) 在 sudo 出现之前,Unix 系统管理员和需要特权操作的…...

【C语言练习】080. 使用C语言实现简单的数据库操作

080. 使用C语言实现简单的数据库操作 080. 使用C语言实现简单的数据库操作使用原生APIODBC接口第三方库ORM框架文件模拟1. 安装SQLite2. 示例代码:使用SQLite创建数据库、表和插入数据3. 编译和运行4. 示例运行输出:5. 注意事项6. 总结080. 使用C语言实现简单的数据库操作 在…...