当前位置: 首页 > 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 …...

25届秋招网络安全面试资料库

吉祥知识星球http://mp.weixin.qq.com/s?__bizMzkwNjY1Mzc0Nw&mid2247485367&idx1&sn837891059c360ad60db7e9ac980a3321&chksmc0e47eebf793f7fdb8fcd7eed8ce29160cf79ba303b59858ba3a6660c6dac536774afb2a6330#rd 《网安面试指南》http://mp.weixin.qq.com/s?…...

Adobe Dimension DN v4.0.2 解锁版下载安装教程 (专业的三维3D建模工具)

前言 Adobe Dimension&#xff08;简称DN&#xff09;是一款3D设计软件&#xff0c;三维合成和渲染工具&#xff0c;2D平面的二维转为3D立体的三维合成工具&#xff0c;用于3Dmax\C4D\MAYA等三维软件生成的效果图&#xff0c;在3D场景中排列对象、图形和光照。3D应用程序使用的…...

Python中*args 和 **kwargs作参数时有什么区别

*args 和 **kwargs 是 Python 函数定义中用于处理可变数量的参数的语法&#xff0c;初学者对于二者总是傻傻区分不了&#xff0c;今天我们就来详细解读一下这两个在参数传递时有什么不同。 首先要明白单个星号可以解包元组或者列表&#xff0c;两个星号可以解包字典。如&#…...

[CSS3]2D与3D变换技术详解

文章目录 2D变换&#xff08;2D Transform&#xff09;3D变换&#xff08;3D Transform&#xff09;结语 CSS3中的2D变换与3D变换是指通过transform属性对HTML元素进行几何操作&#xff0c;使其在二维或三维空间中进行移动、旋转、缩放和倾斜等变换。这些变换为前端开发者提供了…...

大恒相机通过Line2或Line3直接给出3.3V触发,形成分时曝光

大恒相机通过Line2或Line3直接给出3.3V触发&#xff0c;形成分时曝光 一、分时曝光需求二、3.3V信号分时曝光设计 写在前面 上班了&#xff0c;没多少时间再去精度论文了&#xff0c;大多是项目上的事情。 一、分时曝光需求 一般的12V光源通过光源控制器与大恒相机Line1线连接…...

electronjs实现打开的网页密码自动保存

在 Electron 中实现自动保存网页密码的功能涉及到几个步骤&#xff0c;以下是一个基本的实现思路&#xff1a; 1. 监听登录事件 首先&#xff0c;你需要监听用户的登录事件。当用户在一个网页上登录后&#xff0c;通常会有一个 POST 请求发送到服务器验证凭据。你可以监听这个…...

观测云的自动化监控:CRD 资源与自动发现

在云原生技术快速发展的今天&#xff0c;Kubernetes已成为企业容器化应用的中心舞台。随着应用的规模化和动态化&#xff0c;传统的监控方法已经难以满足需求。自动化监控&#xff0c;以其高效性和准确性&#xff0c;成为云原生监控的新趋势。观测云平台通过与Kubernetes的深度…...

九、OpenCVSharp 中的图像形态学操作

文章目录 简介一、腐蚀1. 腐蚀的原理和数学定义2. 结构元素的形状和大小选择3. 腐蚀操作的代码实现和效果展示二、膨胀1. 膨胀的概念和作用2. 与腐蚀的对比和组合使用(如开运算、闭运算)三、开运算1. 开运算的定义和用途(去除小的明亮区域)2. 开运算在去除噪声和分离物体方…...

http和websocket

http和websocket是什么 网络通信的协议 区别 http: 只能客户端发送&#xff0c;服务端接收。 websocket: 客户端和服务端都可以发送和接收数据。 链接...

Go 语言错误处理

不管使用哪种语言&#xff0c;程序代码都可能包含各种错误&#xff0c;例如语法错误、逻辑错误、除 0 错误和文件缺失等。因此&#xff0c;每种编程语言都有处理错误的内置机制。 1. Go 程序中的错误 需要指出的是&#xff0c;错误有多种类型。语法错误通常是开发人员在编写代…...

武汉那些网站做家教的/怎样创建自己的网站

post请求时一般参数放在body里面&#xff0c;选择json格式&#xff0c;如下所示&#xff1a;...

夜间正能量不良网站/群推广

近日&#xff0c;百度网盘终于憋出一个大招&#xff0c;在最新的百度网盘 PC 版 6.9.10 中&#xff0c;该应用新增了下载提速功能&#xff0c;据官方介绍&#xff0c;下载提速功能是百度网盘为改善用户下载体验而推出的一项功能。 不过据众多网友实测&#xff0c;该下载加速仅仅…...

做网站域名重要吗/关键词挖掘长尾词工具

rapidjson是一个高效的C JSON解析&#xff0f;生成器&#xff0c;具有小而全、快且独立等优点&#xff0c;具体用法如下 1、基本单元 rapidjson的基本操作单元&#xff1a;Document以及Value 例&#xff1a;当有一个json案例&#xff0c;请让我们称之为test.json {"te…...

滨江区做网站公司/网站seo搜索

刚刚接触swift以及ios&#xff0c;不是很理解有的逻辑&#xff0c;导致某些问题。这里分享一下swift自定义uicollectionviewcell 首先我的viewcontroller不是直接继承uicollectionviewcontroller&#xff0c;而是添加的uicollectionview到我的storyboard&#xff0c; 然后再新建…...

兰州 网站建设/手机搜索引擎排行榜

1、遇到的bug 我通过APP客户端上传图片时&#xff0c;却发现服务器根本没有接受到此图片&#xff0c;后来才发现图片是3.9M&#xff0c;超过tomcat对http的post请求的默认接收大小2M的限制。 2、问题的根源 tomcat默认设置能接收HTTP POST请求的大小最大为2M,如果你的POST请求传…...

济南房产网签查询系统/网站快速优化排名软件

在阅读深度学习类论文的时候&#xff0c;经常会见到embedding这个名词&#xff0c;却一直不知道其具体含义是什么&#xff0c;遂查询了很多资料&#xff0c;终于明白了其作用&#xff0c;记录于此&#xff0c;希望能帮助对此同样疑惑 的人。 1、在讲embedding之前必须要先说一…...