@@ -42,26 +42,33 @@ export class RequestyHandler extends OpenAiHandler {
4242 }
4343}
4444
45- export async function getRequestyModels ( { apiKey } : { apiKey ?: string } ) {
45+ export async function getRequestyModels ( ) {
4646 const models : Record < string , ModelInfo > = { }
4747
48- if ( ! apiKey ) {
49- return models
50- }
51-
5248 try {
53- const config : Record < string , any > = { }
54- config [ "headers" ] = { Authorization : `Bearer ${ apiKey } ` }
55-
56- const response = await axios . get ( "https://router.requesty.ai/v1/models" , config )
49+ const response = await axios . get ( "https://router.requesty.ai/v1/models" )
5750 const rawModels = response . data . data
5851
5952 for ( const rawModel of rawModels ) {
53+ // {
54+ // id: "anthropic/claude-3-5-sonnet-20240620",
55+ // object: "model",
56+ // created: 1740552655,
57+ // owned_by: "system",
58+ // input_price: 0.0000028,
59+ // caching_price: 0.00000375,
60+ // cached_price: 3e-7,
61+ // output_price: 0.000015,
62+ // max_output_tokens: 8192,
63+ // context_window: 200000,
64+ // supports_caching: true,
65+ // description:
66+ // "Anthropic's previous most intelligent model. High level of intelligence and capability. Excells in coding.",
67+ // }
68+
6069 const modelInfo : ModelInfo = {
6170 maxTokens : rawModel . max_output_tokens ,
6271 contextWindow : rawModel . context_window ,
63- supportsImages : rawModel . support_image ,
64- supportsComputerUse : rawModel . support_computer_use ,
6572 supportsPromptCache : rawModel . supports_caching ,
6673 inputPrice : parseApiPrice ( rawModel . input_price ) ,
6774 outputPrice : parseApiPrice ( rawModel . output_price ) ,
@@ -72,8 +79,15 @@ export async function getRequestyModels({ apiKey }: { apiKey?: string }) {
7279
7380 switch ( rawModel . id ) {
7481 case rawModel . id . startsWith ( "anthropic/claude-3-7-sonnet" ) :
82+ modelInfo . supportsComputerUse = true
83+ modelInfo . supportsImages = true
7584 modelInfo . maxTokens = 16384
7685 break
86+ case rawModel . id . startsWith ( "anthropic/claude-3-5-sonnet-20241022" ) :
87+ modelInfo . supportsComputerUse = true
88+ modelInfo . supportsImages = true
89+ modelInfo . maxTokens = 8192
90+ break
7791 case rawModel . id . startsWith ( "anthropic/" ) :
7892 modelInfo . maxTokens = 8192
7993 break
0 commit comments