ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/thatstupidcomputer / packages/discovery/providers/anthropic/answers.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/thatstupidcomputer / packages/discovery/providers/anthropic/answers.ts
DateNot specified in source
RepositoryJanady13/thatstupidcomputer
Revision57555cde46910102dd25d6c1c1fb2c359e9655bd
Branchmain
Path or archive memberpackages/discovery/providers/anthropic/answers.ts
Original SHA-256b276913ef277eaab2667a5c5fd6db717699fae656fbd8be859f65d938a45ddbd
Git blob SHA35bad9ea3cf8a616d7a2e3aaa1c827f47085649f
Reading-copy SHA-256b276913ef277eaab2667a5c5fd6db717699fae656fbd8be859f65d938a45ddbd

Original source ↗

Recovered source transcript

import {annotated,record,records,type AnswerAdapter} from '../../protocol.ts'; export const anthropicAnswers:AnswerAdapter={ endpoint:'https://api.anthropic.com/v1/messages',auth:'anthropic',headers:{'anthropic-version':'2023-06-01'}, build:(model,query)=>({model,max_tokens:1200,messages:[{role:'user',content:query}],tools:[{type:'web_search_20260318',name:'web_search',max_uses:3,allowed_callers:['direct']}]}), parse:value=>{ if(!record(value)||value.stop_reason!=='end_turn'||!Array.isArray(value.content))return; const content=records(value.content),search=content.filter(c=>c.type==='web_search_tool_result'); if(search.some(c=>!Array.isArray(c.content)))return; // API 200 may contain a tool-result error object. const answer=annotated(content,'text','web_search_result_location','citations'); if(!answer.text.trim())return; return {...answer,searchExecuted:search.length>0,...(typeof value.model==='string'?{responseModel:value.model}:{})}; }, };

Search equations, builds, manuscript text, and recovered sources.