Skip to content

Instantly share code, notes, and snippets.

View TurtleShip's full-sized avatar

Seulgi Kim TurtleShip

View GitHub Profile
{
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "The command to execute"
},
"timeout": {
"type": "number",
"description": "Optional timeout in milliseconds (max 600000)"
@TurtleShip
TurtleShip / code_exec_tool_with_token_count.py
Last active August 11, 2025 05:25
Testing code_execution_20250522 with token counting
#!/usr/bin/env python3
"""
Test script to verify if token counting works with code_execution_20250522 tool.
This answers Brad's question: "Does token counting not work with code_execution_20250522?"
According to the docs:
- Token counting: https://docs.anthropic.com/en/docs/build-with-claude/token-counting
- Code execution tool: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool
"""
@TurtleShip
TurtleShip / semantic_error.md
Last active August 1, 2025 23:00
Semantic errors

Semantic Errors

Definition: "I can parse what you wrote, but it doesn't make sense" - violations of meaning or contracts within a correctly structured format. The parser successfully extracts function calls, but they violate tool contracts or constraints.

Characteristics:

  • Structure (syntax) is valid but violates the tool's interface specification
  • Parser can extract the function call
  • Validation against tool definition fails
  • There exists a potential tool definition that would make this call valid but it is not the one that is in the system prompt

ToolNotFound

@TurtleShip
TurtleShip / syntax_error.md
Created July 31, 2025 19:38
Syntax error explanation

Syntax Errors

Definition: "I can't parse what you wrote" - violations of the language's structural rules that prevent parsing. These are grammatical/structural errors independent of tool definition or user prompt.

Characteristics:

  1. Structure is fundamentally broken
  2. Parser cannot extract function calls
  3. Independent of tool definitions

MalformedFunctionCall

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" }
},
"required": ["street", "city"]
}
[JsonProperty("visibility_policies")]
public List<LinkVisibility> VisibilityPolicies { get; set; }
[JsonProperty("audience_options")]
public List<AudienceOption> AudienceOptions { get; set; }
[JsonIgnore]
public bool IsRighteousLink => AudienceOptions != null;
/*
void UnitConverter::RestoreUserPreferences(const wstring& userPreferences)
{
if (userPreferences.empty())
{
return;
}
vector<wstring> outerTokens = StringToVector(userPreferences, L"|");
if (outerTokens.size() == 3)
{
@TurtleShip
TurtleShip / fail.log
Created March 8, 2016 05:46
출첵 failing
[472] ./~/redux-logger/lib/index.js 8.49 kB {0} [built]
[473] ./src/containers/LectureContainer/LectureContainer.js 4.32 kB {0} [built]
[474] ./src/containers/LectureContainer/LectureActions.js 376 bytes {0} [built]
[475] ./src/components/Lecture/Lectures.js 3.37 kB {0} [built]
[476] ./src/components/Lecture/Lecture.js 3.6 kB {0} [built]
[477] ./src/components/Lecture/Lecture.css 937 bytes {0} [built] [1 error]
[479] ./~/style-loader/addStyles.js 7.21 kB {0} [built]
[480] ./~/react-select/lib/Select.js 30.5 kB {0} [built]
[481] ./~/react-select/~/react-input-autosize/lib/AutosizeInput.js 4.67 kB {0} [built]
[482] ./~/react-select/~/classnames/index.js 1.1 kB {0} [built]
@TurtleShip
TurtleShip / DBlocks.java
Created August 29, 2015 22:05
Bear and Blocks
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class DBlocks {
public static void main(String[] args) {
final Scanner scanner = new Scanner(new BufferedInputStream(System.in));
final PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));
@TurtleShip
TurtleShip / Main.java
Created August 23, 2015 23:07
UVa 10765 - Doves and bombs
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.*;
// UVa 10765 - Doves and bombs
public class Main {
public static void main(String[] args) {
final Scanner scanner = new Scanner(new BufferedInputStream(System.in));