ccproxy.testing.mock_responses¶
ccproxy.testing.mock_responses
¶
Mock response generation for realistic testing.
RealisticMockResponseGenerator
¶
Generate realistic mock responses with proper randomization.
Source code in ccproxy/testing/mock_responses.py
generate_response_content
¶
Generate response content with realistic token counts.
generate_cache_tokens
¶
Generate realistic cache token counts.
Source code in ccproxy/testing/mock_responses.py
should_simulate_error
¶
generate_error_response
¶
Generate realistic error response.
Source code in ccproxy/testing/mock_responses.py
generate_realistic_anthropic_stream
¶
generate_realistic_anthropic_stream(
request_id,
model,
content,
input_tokens,
output_tokens,
cache_read_tokens,
cache_write_tokens,
)
Generate realistic Anthropic streaming chunks.
Source code in ccproxy/testing/mock_responses.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
generate_realistic_openai_stream
¶
Generate realistic OpenAI streaming chunks by converting Anthropic format.
Source code in ccproxy/testing/mock_responses.py
calculate_realistic_cost
¶
calculate_realistic_cost(
input_tokens,
output_tokens,
model,
cache_read_tokens,
cache_write_tokens,
)
Calculate realistic cost based on current Claude pricing.