Skip to content

Instantly share code, notes, and snippets.

View p-i-'s full-sized avatar

Pi p-i-

View GitHub Profile

Anthropic API Bug Report: Cache Control on Tools Array Ignored

Summary

The Anthropic API ignores cache_control markers placed on tools in the tools array, preventing efficient caching of system prompts and tool definitions across requests.

Expected Behavior

When placing a cache_control marker on a tool definition:

// Firefox configuration for containerized environments
// Essential settings to fix container-specific issues
// Completely disable update system (prevents locale file errors)
user_pref("app.update.enabled", false);
user_pref("app.update.auto", false);
user_pref("app.update.service.enabled", false);
user_pref("app.update.url", "");
user_pref("app.update.url.manual", "");
user_pref("app.update.url.details", "");
@p-i-
p-i- / diff.diff
Created October 20, 2024 10:13
clither build on macos
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ed9bc5..ce7842f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ project ("clither"
###############################################################################
include (CMakeDependentOption)
-option (CLITHER_BENCHMARKS "Compile benchmarks (requires C++)" ON)
+option (CLITHER_BENCHMARKS "Compile benchmarks (requires C++)" OFF)
@p-i-
p-i- / CMakeLists.txt
Created October 18, 2024 10:09
WebRTC VAD (c++)
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set the project name and version
project(webrtcvad VERSION 2.0.14)
# Define the source files (excluding pywebrtcvad.c)
file(GLOB VAD_SOURCES
@p-i-
p-i- / aec.cpp
Created October 13, 2024 01:12
AEC on macOS
// clang++ -o x x.cpp -framework CoreAudio -framework AudioToolbox
#include <iostream>
#include <cmath>
#include <fstream>
#include <AudioToolbox/AudioToolbox.h>
constexpr float kSineFrequency = 440.0f; // 440Hz sinewave
constexpr float kSampleRate = 48000.0f; // Sample rate
@p-i-
p-i- / MainComponent.cpp
Created October 12, 2024 16:36
Broken: kAudioUnitSubType_VoiceProcessingIO / macOS
#include "MainComponent.h"
#include <AudioToolbox/AudioToolbox.h>
#include <CoreAudio/CoreAudio.h>
#include <AudioUnit/AudioUnit.h>
#include <cmath>
// SineWaveGenerator methods
SineWaveGenerator::SineWaveGenerator() : currentAngle(0.0), angleDelta(0.0) {}
void SineWaveGenerator::setFrequency(float frequency, double sampleRate)
(.venv)
pi@πlocal ~/code/2024/kit/kit/Gin master
> git diff
diff --git a/modules/gin_network/network/gin_asyncwebsocket.cpp b/modules/gin_network/network/gin_asyncwebsocket.cpp
index 15be54251e..f3a8f057ac 100644
--- a/modules/gin_network/network/gin_asyncwebsocket.cpp
+++ b/modules/gin_network/network/gin_asyncwebsocket.cpp
@@ -6,8 +6,8 @@
==============================================================================*/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p-i-
p-i- / x.ipynb
Created August 8, 2024 12:00
Getting imports from another folder to work in .ipynb in VSCode
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.