MCPcopy Create free account

hub / github.com/1rgs/claude-code-proxy / functions

Functions27 in github.com/1rgs/claude-code-proxy

↓ 3 callersFunctionlog_request_beautifully
Log requests in a beautiful, twitter-friendly format showing Claude to OpenAI mapping.
server.py:1664
↓ 2 callersMethodadd_event
Track information about each received event.
tests.py:383
↓ 2 callersFunctionconvert_anthropic_to_litellm
Convert Anthropic API request format to LiteLLM format (which follows OpenAI).
server.py:464
↓ 2 callersFunctionget_response
Send a request and get the response.
tests.py:199
↓ 2 callersFunctionstream_response
Send a streaming request and process the response.
tests.py:445
↓ 2 callersMethodsummarize
Print a summary of the stream statistics.
tests.py:426
↓ 1 callersFunctionclean_gemini_schema
Recursively removes unsupported fields from a JSON schema for Gemini.
server.py:132
↓ 1 callersFunctioncompare_responses
Compare the two responses to see if they're similar enough.
tests.py:208
↓ 1 callersFunctioncompare_stream_stats
Compare the statistics from the two streams to see if they're similar enough.
tests.py:527
↓ 1 callersFunctionconvert_litellm_to_anthropic
Convert LiteLLM (OpenAI format) response to Anthropic API response format.
server.py:730
↓ 1 callersMethodget_duration
Calculate the total duration of the stream in seconds.
tests.py:420
↓ 1 callersFunctionhandle_streaming
Handle streaming responses from LiteLLM and convert to Anthropic format.
server.py:922
↓ 1 callersFunctionmain
()
tests.py:697
↓ 1 callersFunctionrun_tests
Run all tests based on command-line arguments.
tests.py:634
↓ 1 callersFunctionsanitize_for_json
递归地清理对象使其可以JSON序列化
server.py:1532
↓ 1 callersFunctiontest_request
Run a test with the given request data.
tests.py:318
↓ 1 callersFunctiontest_streaming
Run a streaming test with the given request data.
tests.py:568
Method__init__
(self)
tests.py:369
Functioncount_tokens
(request: TokenCountRequest, raw_request: Request)
server.py:1568
Functioncreate_message
(request: MessagesRequest, raw_request: Request)
server.py:1215
Methodfilter
(self, record)
server.py:39
Methodformat
(self, record)
server.py:72
Functionlog_requests
(request: Request, call_next)
server.py:402
Functionparse_tool_result_content
Helper function to properly parse and normalize tool result content.
server.py:419
Functionroot
()
server.py:1646
Methodvalidate_model_field
(cls, v, info)
server.py:230
Methodvalidate_model_token_count
(cls, v, info)
server.py:310