腾讯云 AI 代码助手-python代码开发助手

Python 编程助手

作品简介

对于编程新手来说,Python 编程可能会遇到各种问题,从语法错误到逻辑难题。本作品旨在为 Python 编程爱好者提供一个便捷的编程助手,通过简单的对话或粘贴代码片段,即可获得帮助和解答,简单方便。

技术架构

采用了全后端分离的架构,前端使用Vue.js,腾讯云的AI服务处理自然语言理解与生成。

实现过程

开发环境、开发流程

  • 系统:Windows 11
  • 开发工具:vscode
  • 开发环境:Python 3.9

开发流程

开发环境:node-v23.6.0-win-x64
开发流程:装好node后使用npm i初始化项目,使用npm run dev启动项目

关键技术解析

使用web样式将ai部署在网页中

腾讯云 AI 代码助手在上述过程中的助力

  1. 理解代码

    • 通过腾讯云 AI 代码助手,快速理解代码逻辑和功能。
      在这里插入图片描述
  2. 增加标识内容

    • 给页面增加了显示的 title,使用腾讯云 AI 代码助手完成的所有内容。
  3. 完成了不少的代码区域

效果展示

请添加图片描述

演示视频地址:Python 编程助手 - 优快云

代码示例

前端部分(Vue.js)

<template>
  <t-chat
    ref="chatRef"
    layout="single"
    style="height: 600px"
    :clear-history="chatList.length > 0 && !isStreamLoad"
    @clear="clearConfirm"
    
  >
    <template v-for="(item, index) in chatList" :key="index">
      <t-chat-item
        :avatar="item.avatar"
        :name="item.name"
        :role="item.role"
        :datetime="item.datetime"
        :content="item.content"
        :text-loading="index === 0 && loading"
      >
        <template v-if="!isStreamLoad" #actions>
          <t-chat-action
            :is-good="isGood"
            :is-bad="isBad"
            :content="item.content"
            @operation="(type, { e }) => handleOperation(type, { e, index })"
          />
        </template>
      </t-chat-item>
    </template>
    <template #footer>
      <t-chat-input :stop-disabled="isStreamLoad" @send="inputEnter" @stop="onStop"> </t-chat-input>
    </template>
  </t-chat>
  <h1
    style="
      text-align: center;
      margin-top: 20px;
      font-family: 'Arial', sans-serif;
      color: #f8fae4;
      background-color: #a48be6;
      padding: 10px 20px;
      border-radius: 5px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    "
  >
    Python 编程助手
  </h1>
</template>
<script setup>
import {
     
      ref } from 'vue';

const fetchCancel = ref(null);
const loading = ref(false);
const isStreamLoad = ref(false);
const isGood = ref(false);
const isBad = ref(false);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值