original: https://github.com/wujianguo/openai-proxy
- flask_proxy_for_continue: 修复了硅基流动 reasoning_content 在 continue 插件不显示的问题;对于文本总结自动换用一个小模型
- flask_proxy:original 的备份,改了目标地址为硅基流动
和 pyhttpdbg 一起用,可以观察app到底给大模型发送了什么
pyhttpdbg --script proxy.py
import os | |
import json | |
import time | |
from datetime import datetime | |
from openai import OpenAI | |
import argparse | |
from typing import Dict, List, Any, Optional, Union, TypedDict, cast | |
from dataclasses import dataclass | |
@dataclass |
original: https://github.com/wujianguo/openai-proxy
和 pyhttpdbg 一起用,可以观察app到底给大模型发送了什么
pyhttpdbg --script proxy.py
createWithNestedDefaults = (messageType) => { | |
const message = messageType.create(); | |
console.log(message); | |
// 遍历消息的属性 | |
for (const [key, field] of Object.entries(messageType.fields)) { | |
// 检查该属性是否是嵌套的消息类型 | |
console.log(field) |
// ==UserScript== | |
// @name Mermaid Diagram Renderer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Render Mermaid diagrams from selected text | |
// @author Claude | |
// @match *://*/* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.14.0/mermaid.min.js | |
// @grant GM_addStyle | |
// ==/UserScript== |
document.addEventListener('DOMContentLoaded', function() { | |
const c = document.getElementById("c"); | |
if (!c) { | |
console.error("Canvas element with id 'c' not found"); | |
return; | |
} | |
const ctx = c.getContext("2d"); | |
if (!ctx) { | |
console.error("Unable to get 2D context for canvas"); |
// MyProtocol.h | |
#pragma once | |
#include <array> | |
#include <vector> | |
#include <string> | |
#include <memory> | |
#include <chrono> | |
#include <mutex> |
javascript:(function() { | |
// 获取当前时间 | |
var now = new Date(); | |
var formattedTime = now.toISOString().slice(0, 16); // 格式化为 YYYY-MM-DDTHH:MM | |
// 找到 DateTimePicker 的 input 元素 | |
var inputElement = document.querySelector('.el-date-editor input'); | |
if (inputElement) { | |
// 模拟用户点击 input 元素 | |
inputElement.click(); |
import os | |
import logging | |
import requests | |
import subprocess | |
from pathlib import Path | |
from datetime import datetime | |
import time | |
import json | |
import time |
// 对于没有命名空间的变量 | |
#define BUILD_MY_FUNC_SINGLE(name) Build##name##Processor() | |
// 对于有命名空间的变量 | |
#define BUILD_MY_FUNC_NS(ns, name) Build##ns##name##Processor() | |
// 定义一个辅助宏,根据参数数量调用正确的宏 | |
#define GET_MACRO(_1,_2,NAME,...) NAME | |
#define BUILD_MY_FUNC(...) GET_MACRO(__VA_ARGS__, BUILD_MY_FUNC_NS, BUILD_MY_FUNC_SINGLE)(__VA_ARGS__) |
type PromiseFunction<T> = () => Promise<T>; | |
type PromiseResult<T> = { status: 'fulfilled', value: T } | { status: 'rejected', reason: any }; | |
async function allSettledWithConcurrency<T>(promises: PromiseFunction<T>[], concurrency: number): Promise<PromiseResult<T>[]> { | |
const results: PromiseResult<T>[] = new Array(promises.length); | |
let running = 0; | |
let index = 0; | |
return new Promise((resolve) => { | |
const enqueue = () => { |