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

OpenAI API推出结构化输出功能

  每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗?订阅我们的简报,深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同,从行业内部的深度分析和实用指南中受益。不要错过这个机会,成为AI领域的领跑者。点击订阅,与未来同行! 订阅:https://rengongzhineng.io/

去年在DevDay大会上,OpenAI介绍了JSON模式,这个工具对于开发者来说是构建可靠应用程序的有用模块。虽然JSON模式提高了模型生成有效JSON输出的可靠性,但并不能保证模型的响应会符合特定的架构。今天,OpenAI推出了一项新功能——API中的结构化输出,旨在确保模型生成的输出完全符合开发者提供的JSON架构。

从非结构化输入生成结构化数据是现代应用程序中人工智能的核心用例之一。开发者使用OpenAI API构建功能强大的助手,这些助手可以通过函数调用获取数据并回答问题,提取结构化数据进行数据输入,并构建多步代理工作流,使大型语言模型能够采取行动。开发者长期以来一直通过开源工具、提示和反复重试请求来解决大型语言模型在这方面的局限性,确保模型输出符合其系统所需的格式。结构化输出通过约束OpenAI模型以符合开发者提供的架构,并训练模型更好地理解复杂的架构,解决了这一问题。

在对复杂JSON架构遵循性的评估中,OpenAI的新模型gpt-4o-2024-08-06在结构化输出方面得分为100%,而gpt-4-0613得分不到40%。

有了结构化输出,gpt-4o-2024-08-06在评估中实现了100%的可靠性,完美匹配输出架构。

如何使用结构化输出

OpenAI在API中以两种形式引入结构化输出:

  1. 函数调用:通过工具启用的结构化输出可以在函数定义中设置strict: true来实现。这一功能适用于所有支持工具的模型,包括gpt-4-0613和gpt-3.5-turbo-0613及其后续版本。当启用结构化输出时,模型输出将匹配提供的工具定义。

请求:
POST /v1/chat/completions
{"model": "gpt-4o-2024-08-06","messages": [{"role": "system","content": "You are a helpful assistant. The current date is August 6, 2024. You help users query for the data they are looking for by calling the query function."},{"role": "user","content": "look up all my orders in may of last year that were fulfilled but not delivered on time"}],"tools": [{"type": "function","function": {"name": "query","description": "Execute a query.","strict": true,"parameters": {"type": "object","properties": {"table_name": {"type": "string","enum": ["orders"]},"columns": {"type": "array","items": {"type": "string","enum": ["id","status","expected_delivery_date","delivered_at","shipped_at","ordered_at","canceled_at"]}},"conditions": {"type": "array","items": {"type": "object","properties": {"column": {"type": "string"},"operator": {"type": "string","enum": ["=", ">", "<", ">=", "<=", "!="]},"value": {"anyOf": [{"type": "string"},{"type": "number"},{"type": "object","properties": {"column_name": {"type": "string"}},"required": ["column_name"],"additionalProperties": false}]}},"required": ["column", "operator", "value"],"additionalProperties": false}},"order_by": {"type": "string","enum": ["asc", "desc"]}},"required": ["table_name", "columns", "conditions", "order_by"],"additionalProperties": false}}}]
}

输出:

{"table_name": "orders","columns": ["id", "status", "expected_delivery_date", "delivered_at"],"conditions": [{"column": "status","operator": "=","value": "fulfilled"},{"column": "ordered_at","operator": ">=","value": "2023-05-01"},{"column": "ordered_at","operator": "<","value": "2023-06-01"},{"column": "delivered_at","operator": ">","value": {"column_name": "expected_delivery_date"}}],"order_by": "asc"
}

  1. 响应格式的新选项:开发者现在可以通过json_schema提供JSON Schema,这是response_format参数的新选项。当模型不调用工具而是以结构化方式响应用户时,这一功能非常有用。这一功能适用于OpenAI最新的GPT-4o模型:gpt-4o-2024-08-06和gpt-4o-mini-2024-07-18。当提供response_format并设置strict: true时,模型输出将匹配提供的架构。

请求:

POST /v1/chat/completions
{"model": "gpt-4o-2024-08-06","messages": [{"role": "system","content": "You are a helpful math tutor."},{"role": "user","content": "solve 8x + 31 = 2"}],"response_format": {"type": "json_schema","json_schema": {"name": "math_response","strict": true,"schema": {"type": "object","properties": {"steps": {"type": "array","items": {"type": "object","properties": {"explanation": {"type": "string"},"output": {"type": "string"}},"required": ["explanation", "output"],"additionalProperties": false}},"final_answer": {"type": "string"}},"required": ["steps", "final_answer"],"additionalProperties": false}}}
}

输出:

{"steps": [{"explanation": "Subtract 31 from both sides to isolate the term with x.","output": "8x + 31 - 31 = 2 - 31"},{"explanation": "This simplifies to 8x = -29.","output": "8x = -29"},{"explanation": "Divide both sides by 8 to solve for x.","output": "x = -29 / 8"}],"final_answer": "x = -29 / 8"
}

安全的结构化输出

安全性是OpenAI的首要任务——新的结构化输出功能将遵循现有的安全政策,并且仍然允许模型拒绝不安全的请求。为了简化开发,API响应中增加了一个新的refusal字符串值,允许开发者以编程方式检测模型是否生成了拒绝,而不是匹配架构的输出。当响应不包含拒绝且模型的响应未被提前中断时(如由finish_reason指示),则模型的响应将可靠地产生匹配提供架构的有效JSON。

原生SDK支持

OpenAI的Python和Node SDK已更新,提供对结构化输出的原生支持。提供工具或响应格式的架构与提供Pydantic或Zod对象一样简单,SDK将处理将数据类型转换为支持的JSON架构,自动将JSON响应反序列化为类型化的数据结构,并在出现拒绝时解析它们。

以下示例显示了使用函数调用的结构化输出的原生支持。

Python:

from enum import Enum
from typing import Union
from pydantic import BaseModel
import openai
from openai import OpenAIclass Table(str, Enum):orders = "orders"customers = "customers"products = "products"class Column(str, Enum):id = "id"status = "status"expected_delivery_date = "expected_delivery_date"delivered_at = "delivered_at"shipped_at = "shipped_at"ordered_at = "ordered_at"canceled_at = "canceled_at"class Operator(str, Enum):eq = "="gt = ">"lt = "<"le = "<="ge = ">="ne = "!="class OrderBy(str, Enum):asc = "asc"desc = "desc"class DynamicValue(BaseModel):column_name: strclass Condition(BaseModel):column: stroperator: Operatorvalue: Union[str, int, DynamicValue]class Query(BaseModel):table_name: Tablecolumns: list[Column]conditions: list[Condition]order_by: OrderByclient = OpenAI()completion = client.beta.chat.completions.parse(model="gpt-4o-2024-08-06",messages=[{"role": "system","content": "You are a helpful assistant. The current date is August 6, 2024. You help users query for the data they are looking for by calling the query function.",},{"role": "user","content": "look up all my orders in may of last year that were fulfilled but not delivered on time",},],tools=[openai.pydantic_function_tool(Query),],
)print(completion.choices[0].message.tool_calls[0].function.parsed_arguments)

Node:

import OpenAI from 'openai';
import z from 'zod';
import { zodFunction } from 'openai/helpers/zod';const Table = z.enum(['orders', 'customers', 'products']);
const Column = z.enum(['id','status','expected_delivery_date','delivered_at','shipped_at','ordered_at','canceled_at',
]);
const Operator = z.enum(['=', '>', '<', '<=', '>=', '!=']);
const OrderBy = z.enum(['asc', 'desc']);const DynamicValue = z.object({column_name: z.string(),
});const Condition = z.object({column: z.string(),operator: Operator,value: z.union([z.string(), z.number(), DynamicValue]),
});const QueryArgs = z.object({table_name: Table,columns: z.array(Column),conditions: z.array(Condition),order_by: OrderBy,
});const client = new OpenAI();const completion = await client.beta.chat.completions.parse({model: 'gpt-4o-2024-08-06',messages: [{ role: 'system', content: 'You are a helpful assistant. The current date is August 6, 2024. You help users query for the data they are looking for by calling the query function.' },{ role: 'user', content: 'look up all my orders in may of last year that were fulfilled but not delivered on time' }],tools: [zodFunction({ name: 'query', parameters: QueryArgs })],
});
console.log(completion.choices[0].message.tool_calls[0].function.parsed_arguments);

响应格式的原生支持也可用。

Python:

from pydantic import BaseModel
from openai import OpenAIclass Step(BaseModel):explanation: stroutput: strclass MathResponse(BaseModel):steps: list[Step]final_answer: strclient = OpenAI()completion = client.beta.chat.completions.parse(model="gpt-4o-2024-08-06",messages=[{"role": "system", "content": "You are a helpful math tutor."},{"role": "user", "content": "solve 8x + 31 = 2"},],response_format=MathResponse,
)message = completion.choices[0].message
if message.parsed:print(message.parsed.steps)print(message.parsed.final_answer)
else:print(message.refusal)

Node:

import OpenAI from 'openai';
import { zodResponseFormat } from 'openai/helpers/zod';
import { z } from 'zod';const Step = z.object({explanation: z.string(),output: z.string(),
});const MathResponse = z.object({steps: z.array(Step),final_answer: z.string(),
});const client = new OpenAI();const completion = await client.beta.chat.completions.parse({model: 'gpt-4o-2024-08-06',messages: [{"role": "system","content": "You are a helpful math tutor. Only use the schema for math responses.",},{ "role": "user", "content": "solve 8x + 3 = 21" },],response_format: zodResponseFormat(MathResponse, 'mathResponse'),
});const message = completion.choices[0]?.message;
if (message?.parsed) {console.log(message.parsed.steps);console.log(message.parsed.final_answer);
} else {console.log(message.refusal);
}

其他使用案例

开发者经常使用OpenAI的模型生成结构化数据以满足各种使用需求。以下是一些额外的示例:

根据用户意图动态生成用户界面

例如,开发者可以使用结构化输出创建代码或用户界面生成应用程序。以下所有示例都使用相同的response_format,可以根据用户输入生成不同的用户界面。

系统:

{"type": "div","label": "","children": [{"type": "header","label": "","children": [{"type": "div","label": "Green Thumb Gardening","children": [],"attributes": [{ "name": "className", "value": "site-title" }]},{"type": "div","label": "Bringing Life to Your Garden","children": [],"attributes": [{ "name": "className", "value": "site-tagline" }]}],"attributes": [{ "name": "className", "value": "header" }]},{"type": "section","label": "","children": [{"type": "div","label": "","children": [{"type": "div","label": "About Us","children": [{"type": "div","label": "At Green Thumb Gardening, we specialize in transforming your outdoor spaces into beautiful, thriving gardens. Our team has decades of experience in horticulture and landscape design.","children": [],"attributes": [{ "name": "className", "value": "about-description" }]}],"attributes": [{ "name": "className", "value": "about-section" }]}],"attributes": [{ "name": "className", "value": "content" }]}],"attributes": [{ "name": "className", "value": "about-container" }]},{"type": "section","label": "","children": [{"type": "div","label": "","children": [{"type": "div","label": "Our Services","children": [{"type": "div","label": "Garden Design","children": [],"attributes": [{ "name": "className", "value": "service-item" }]},{"type": "div","label": "Plant Care & Maintenance","children": [],"attributes": [{ "name": "className", "value": "service-item" }]},{"type": "div","label": "Seasonal Cleanup","children": [],"attributes": [{ "name": "className", "value": "service-item" }]},{"type": "div","label": "Custom Landscaping","children": [],"attributes": [{ "name": "className", "value": "service-item" }]}],"attributes": [{ "name": "className", "value": "services-list" }]}],"attributes": [{ "name": "className", "value": "content" }]}],"attributes": [{ "name": "className", "value": "services-container" }]}],"attributes": [{ "name": "className", "value": "landing-page" }]
}

将最终答案与支持推理或额外评论分开

给模型一个单独的思维链字段可以提高最终响应的质量。

请求:

{"model": "gpt-4o-2024-08-06","messages": [{"role": "system","content": "You are a helpful assistant"},{"role": "user","content": "9.11和9.9哪个更大?"}],"response_format": {"type": "json_schema","json_schema": {"name": "reasoning_schema","strict":true,"schema": {"type": "object","properties": {"reasoning_steps": {"type": "array","items": {"type": "string"},"description": "推理步骤,得出最终结论。"},"answer": {"type": "string","description": "最终答案,考虑推理步骤。"}},"required": ["reasoning_steps", "answer"],"additionalProperties": false}}}
}

输出:

{"reasoning_steps": ["第一步是比较数字9.11和9.9。","这两个数字都有相同的整数部分,即9。","要比较小数部分,请将它们转换为相同的小数位数。","9.11有两位小数:它是9.11。","9.9有一位小数:可以写成9.90。","现在,通过查看小数部分来比较9.11和9.90。","比较11和90。","90大于11,所以9.90大于9.11。"],"answer": "9.9大于9.11。"
}

从非结构化数据中提取结构化数据

例如,指示模型从会议记录中提取待办事项、截止日期和负责人。

请求:

POST /v1/chat/completions
{"model": "gpt-4o-2024-08-06","messages": [{"role": "system","content": "从会议记录中提取行动项、截止日期和负责人。"},{"role": "user","content": "...会议记录在此..."}],"response_format": {"type": "json_schema","json_schema": {"name": "action_items","strict": true,"schema": {"type": "object","properties": {"action_items": {"type": "array","items": {"type": "object","properties": {"description": {"type": "string","description": "行动项描述。"},"due_date": {"type": ["string", "null"],"description": "行动项的截止日期,如果没有指定可以为null。"},"owner": {"type": ["string", "null"],"description": "负责行动项的负责人,如果没有指定可以为null。"}},"required": ["description", "due_date", "owner"],"additionalProperties": false},"description": "会议中的行动项列表。"}},"required": ["action_items"],"additionalProperties": false}}}
}

输出:

{"action_items": [{"description": "协作优化路径规划算法","due_date": "2024-06-30","owner": "Jason Li"},{"description": "联系行业合作伙伴获取更多数据集","due_date": "2024-06-25","owner": "Aisha Patel"},{"description": "探索替代的LIDAR传感器配置并报告结果","due_date": "2024-06-27","owner": "Kevin Nguyen"},{"description": "安排集成导航系统的扩展压力测试","due_date": "2024-06-28","owner": "Emily Chen"},{"description": "修复错误后重新测试系统并更新团队","due_date": "2024-07-01","owner": "David Park"}]
}

工作原理

OpenAI采用了两步方法来提高与JSON Schema匹配的模型输出的可靠性。首先,训练了最新的模型gpt-4o-2024-08-06,以理解复杂的架构并最佳地生成匹配它们的输出。然而,模型行为本质上是非确定性的——尽管这一模型的性能有所提高(在基准测试中得分为93%),但它仍未达到开发者构建强大应用程序所需的可靠性。因此,OpenAI还采用了一种确定性、工程性的方法来约束模型的输出,以实现100%的可靠性。

限制与注意事项

使用结构化输出时需要注意以下几点:

  • 结构化输出仅允许JSON Schema的一个子集,详细信息请参见文档。这有助于确保最佳性能。
  • 第一次API响应使用新架构时会有额外的延迟,但随后的响应将快速且无延迟惩罚。因为在第一次请求期间,OpenAI需要处理架构并生成可高效重用的缓存结构。
  • 如果模型选择拒绝不安全的请求,它可能会无法遵循架构。如果选择拒绝,返回消息将包含refusal布尔值以指示这一点。
  • 如果生成达到max_tokens或其他停止条件之前,模型可能无法遵循架构。
  • 结构化输出并不能防止所有类型的模型错误。例如,模型仍可能在JSON对象的值中犯错(例如,在数学方程中出错)。如果开发者发现错误,建议在系统指令中提供示例或将任务拆分为更简单的子任务。
  • 结构化输出与并行函数调用不兼容。生成并行函数调用时,可能不会匹配提供的架构。设置parallel_tool_calls: false以禁用并行函数调用。
  • 提供的JSON架构不符合零数据保留(ZDR)资格。

可用性

结构化输出现已在API中普遍可用。

通过函数调用实现的结构化输出适用于所有支持函数调用的API模型。这包括OpenAI最新的模型(gpt-4o,gpt-4o-mini),所有gpt-4-0613及以后和gpt-3.5-turbo-0613及其后续版本,以及任何支持函数调用的微调模型。此功能适用于聊天补全API、助手API和批量API。通过函数调用实现的结构化输出也兼容视觉输入。

通过响应格式实现的结构化输出适用于gpt-4o-mini和gpt-4o-2024-08-06及基于这些模型的任何微调模型。此功能适用于聊天补全API、助手API和批量API。通过响应格式实现的结构化输出也兼容视觉输入。

通过切换到新的gpt-4o-2024-08-06,开发者在输入方面节省50%($2.50/百万输入tokens),在输出方面节省33%($10.00/百万输出tokens),相较于gpt-4o-2024-05-13。

要开始使用结构化输出,请查看OpenAI的文档。(https://platform.openai.com/docs/guides/structured-outputs)

相关文章:

OpenAI API推出结构化输出功能

每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗&#xff1f;订阅我们的简报&#xff0c;深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同&#xff0c;从行业内部的深度分析和实用指南中受益。不要错过这个机会&#xff0c;成为AI领…...

Python 异步编程:Sqlalchemy 异步实现方式

SQLAlchemy 是 Python 中最流行的数据库工具之一&#xff0c;在新版本中引入了对异步操作的支持。这为使用异步框架&#xff08;如 FastAPI&#xff09;开发应用程序带来了极大的便利。在这篇文章中&#xff0c;简单介绍下 SQLAlchemy 是如何利用 Greenlet 实现异步操作的。 什…...

父类引用指向子类对象

在 Java 中&#xff0c;父类引用可以指向子类对象&#xff0c;这是多态的一种表现。这种特性允许你使用父类的引用来操作子类对象&#xff0c;从而实现更灵活和可扩展的代码设计。 基本概念 多态&#xff1a;父类引用可以指向子类对象。这使得你可以用统一的接口处理不同的对象…...

分享一个基于Spring Boot的面向社区的智能化健康管理系统的设计与实现(源码、调试、LW、开题、PPT)

&#x1f495;&#x1f495;作者&#xff1a;计算机源码社 &#x1f495;&#x1f495;个人简介&#xff1a;本人 八年开发经验&#xff0c;擅长Java、Python、PHP、.NET、Node.js、Android、微信小程序、爬虫、大数据、机器学习等&#xff0c;大家有这一块的问题可以一起交流&…...

【扒代码】reduction参数是什么

model DensityMapRegressor(in_channels256, reduction8)reduction 参数在 DensityMapRegressor 类中用于决定模型在上采样过程中的层级配置。具体来说&#xff0c;它决定了上采样过程中使用多少个 UpsamplingLayer&#xff0c;从而影响输出的分辨率。 reduction 参数的作用 …...

Python,Spire.Doc模块,处理word、docx文件,极致丝滑

Python处理word文件&#xff0c;一般都是推荐的Python-docx&#xff0c;但是只写出一个&#xff0c;一句话的文件&#xff0c;也没有什么样式&#xff0c;就是36K。 再打开word在另存一下&#xff0c;就可以到7-8k&#xff0c;我想一定是python-docx的问题&#xff0c;但一直没…...

redis的安装与命令

一、redis与memcache总体对比 1.性能 Redis&#xff1a;只使用单核&#xff0c;平均每一个核上Redis在存储小数据时比Memcached性能更高。 Memcached&#xff1a;可以使用多核&#xff0c;而在100k以上的数据中&#xff0c;Memcached性能要高于Redis。 2.内存使用效率 Mem…...

【C++】特殊类设计类型转换

目录 &#x1f4a1;前言一&#xff0c;特殊类设计1. 请设计一个类&#xff0c;不能被拷贝2. 请设计一个类&#xff0c;只能在堆上创建对象3. 请设计一个类&#xff0c;只能在栈上创建对象4. 请设计一个类&#xff0c;不能被继承5. 请设计一个类&#xff0c;只能创建一个对象(单…...

为git 命令行 设置代理环境变量

http://t.csdnimg.cn/cAxkg 国内需要修改pinoko根目录下gitconfig文件&#xff0c;添加 [http]proxy http://127.0.0.1:1080 [https]proxy https://127.0.0.1:1080或者通过命令行配置&#xff1a; git config --global http.proxy http://127.0.0.1:1080 git config --glo…...

自定义linux某些常见配置

1.当前路径 echo "PS1\u\h:\w\$ " >> /etc/profile source /etc/profile 2.ssh使能 1.开启openssh 2.权限赋予chown root.root /var/empty/ 3.开发板作为server echo "PermitRootLogin yes" >> /etc/ssh/sshd_config 3开机自启动脚本 1.init…...

告别手动操作!KeyMouseGo实现自动化工作流

前言 在这个快节奏的时代&#xff0c;我们每天都在与电脑打交道&#xff0c;重复着那些繁琐而单调的操作&#xff1b;你是否曾想过&#xff0c;能让电脑自己完成这些任务&#xff0c;而你则悠闲地喝着咖啡&#xff0c;享受着生活&#xff1f;今天&#xff0c;就让我们一起揭开一…...

大型语言模型微调 新进展-4篇 论文

1. Brevity is the soul of wit: Pruning long files for code generation 发布时间&#xff1a;2024-06-29链接&#xff1a;https://arxiv.org/abs/2407.00434机构&#xff1a;伦敦大学学院 (UCL) 本研究针对大型语言模型的代码生成任务中的数据清理问题进行了探索。研究发现…...

专业课140+杭电杭州电子科技大学843信号与系统考研经验电子信息与通信工程真题,大纲,参考书。

顺利上岸杭电&#xff0c;由于专业课考的不错140&#xff0c;群里不少同学希望分享一点经验&#xff0c;回头看看这一年考研复习&#xff0c;确实有得有失&#xff0c;总结一下自己的专业课复习经验&#xff0c;希望对大家有帮助&#xff0c;基础课考的没有专业好&#xff0c;而…...

php 中 (0 == ‘abc‘) 为真

https://andi.cn/page/621653.html...

MacOS Anaconda 安装教程及虚拟环境创建

一、下载 Anaconda 1、Anaconda 官网 2、清华大学开源软件镜像站 点 Date 按时间排序&#xff0c;根据自己 Mac 芯片类型下载对应最新版本的。 Intel 芯片的下载 x86_64 版本的Apple m1 芯片的下载 arm64 版本的 二、安装 Anaconda 将安装包下载到本地后&#xff0c;双击安…...

Mac快速配置ADB环境变量

ADB是进行 Androd 开发时很常用的调试工具&#xff0c;Android SDK 中就包含了该工具&#xff0c;所以如果安装了SDK那只需要在环境变量中配置 Android SDK 的路径即可&#xff0c;本文的环境配置也基于这种场景。 如果需要独立下载 ADB 工具&#xff0c;请参考下面网址&#x…...

Kylin的工作原理及使用分享

前言 在当今信息爆炸的时代&#xff0c;企业和研究机构每天都在生成和收集大量的数据。这些数据中蕴藏着巨大的商业价值和研究潜力&#xff0c;但要从中提取出有用的信息却并非易事。传统的数据处理和分析技术在面对如此庞大的数据量时&#xff0c;往往难以提供快速和有效的响…...

python 使用seleniumwire获取响应数据

seleniumwire 是一个在 Selenium WebDriver 基础上扩展的库&#xff0c;它允许你在使用 Selenium 进行网页自动化测试或爬虫时捕获和修改 HTTP 请求和响应。这对于需要分析网页数据或进行更复杂的网络交互的自动化任务特别有用。 以下是如何使用 seleniumwire 来获取响应数据的…...

用C语言实现双向链表

目录 一.双向链表的结构 二. 双向链表的实现 1. 在List.h中结构体的定义和各函数的声明 1.1 结构体&#xff08;节点&#xff09;的定义 1.2 各函数的声明 2. 在List.c中各函数的实现 2.1 初始化 LTInit 2.2 尾插 LTPushBack 2.3 打印 LTPrint 2.4 头插 LTPushFron…...

Github 2024-08-10 Rust开源项目日报Top10

根据Github Trendings的统计,今日(2024-08-10统计)共有10个项目上榜。根据开发语言中项目的数量,汇总情况如下: 开发语言项目数量Rust项目10Python项目1Turbo:下一代前端开发工具链 创建周期:977 天开发语言:Rust协议类型:MIT LicenseStar数量:25308 个Fork数量:1713 …...

深入解析 ESLint 配置:从零到精通

深入解析 ESLint 配置&#xff1a;从零到精通 ESLint 是一个强大的代码检查工具&#xff0c;主要用于识别 JavaScript 和其他支持的语言中的常见编程错误&#xff0c;并强制执行一致的编码风格。自2013年6月由Nicholas C. Zakas创建以来&#xff0c;ESLint 已成为前端开发中不…...

BTC连续拉涨,击碎空头幻想

原创 | 刘教链 隔夜BTC继续拉涨&#xff0c;急破6万刀&#xff0c;“过了黄洋界&#xff0c;险处不须看”&#xff0c;一度逼近63k&#xff0c;目前暂于61-62k区间休整。从8月5日极限插针下探49k&#xff0c;仅仅3天多时间&#xff0c;就连续拉涨到了61k&#xff0c;总涨幅接近…...

【Spring】Sping笔记01

参考学习&#xff1a;b站浪飞yes ---------------------------------------------------- # 一、Spring 引入 **事务实现** java public class EmployeeServiceImpl implements IEmployeeService { public void save(Employee employee){ // 打开资源 /…...

Gridcontrol纵向/横向合并单元格

指定列值相同&#xff0c;纵向合并&#xff1a; this.gridView1.OptionsView.AllowCellMerge true;//启用合并列 // 启用指定合并列事件 this.gridView1.CellMerge new DevExpress.XtraGrid.Views.Grid.CellMergeEventHandler(gridView1_CellMerge);#region 合并指定的列 pri…...

从周杰伦的《青花瓷》三次更名看方文山的国学情怀与工匠精神

《青花瓷》三次更名&#xff0c;方文山的国学情怀与工匠精神 在华语乐坛上&#xff0c;周杰伦与方文山的合作堪称黄金组合&#xff0c;他们的作品不仅引领了流行音乐的潮流&#xff0c;更让传统文化焕发出新的生机。在这其中&#xff0c;《青花瓷》无疑是他们合作的经典之一&a…...

HATS:分层图注意力神经网络用于股票预测

HATS&#xff1a;分层图注意力神经网络用于股票预测 原创 QuantML QuantML 2024年08月09日 19:08 上海 Content 本文提出了一种名为HATS&#xff08;Hierarchical Graph Attention Network&#xff09;的分层图注意力网络&#xff0c;用于预测股市动向。HATS通过选择性地聚合…...

【日常记录-MySQL】MySQL设置root用户密码

Author&#xff1a;赵志乾 Date&#xff1a;2024-08-09 Declaration&#xff1a;All Right Reserved&#xff01;&#xff01;&#xff01; 1. 简介 MySQL8.0.30安装后启动&#xff0c;发现root用户尚未设置密码。以下是两种设置root用户密码的方式。 2. 示例 2.1 mysqladmin…...

高级Web安全技术(第二篇)

我们继续第二篇&#xff0c;继续深入了解web的安全 一、概述 在Web应用的开发与部署中&#xff0c;安全问题不仅是技术挑战&#xff0c;更是对系统整体架构的考验。本篇文章将继续深入探讨高级Web安全技术&#xff0c;重点关注API安全的最佳实践、OAuth的安全实施以及安全编码…...

前端实现文件下载常用几种方式

项目中前端下载一般分为两种情况&#xff1a; 后端直接提供一个文件地址&#xff0c;通过浏览器打开就可以下载。需要发送请求&#xff0c;后端返回二进制流数据&#xff0c;前端解析流数据&#xff0c;生成URL实现下载。 前端对应的实质是a标签和Blob文件下载&#xff0c;这…...

Isaac Lab 安装 (ubuntu22.04环境)

Windows下的安装见这篇博客&#xff1a; Isaac Lab 安装与初体验 &#xff08;windows环境&#xff09;-CSDN博客 ubuntu22.04下的安装与windows下十分类似&#xff0c;还是参考官方的&#xff0c;Installation using Isaac Sim Binaries Installation using Isaac Sim Bina…...