mirror of
				https://github.com/ItzCrazyKns/Perplexica.git
				synced 2025-11-03 20:28:14 +00:00 
			
		
		
		
	User customizable context window for ollama models.
This commit is contained in:
		@@ -197,6 +197,8 @@ const useSocket = (
 | 
			
		||||
            'openAIBaseURL',
 | 
			
		||||
            localStorage.getItem('openAIBaseURL')!,
 | 
			
		||||
          );
 | 
			
		||||
        } else {
 | 
			
		||||
          searchParams.append('ollamaContextWindow', localStorage.getItem('ollamaContextWindow') || '2048')
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        searchParams.append('embeddingModel', embeddingModel!);
 | 
			
		||||
 
 | 
			
		||||
@@ -33,9 +33,9 @@ const SearchImages = ({
 | 
			
		||||
 | 
			
		||||
            const chatModelProvider = localStorage.getItem('chatModelProvider');
 | 
			
		||||
            const chatModel = localStorage.getItem('chatModel');
 | 
			
		||||
 | 
			
		||||
            const customOpenAIBaseURL = localStorage.getItem('openAIBaseURL');
 | 
			
		||||
            const customOpenAIKey = localStorage.getItem('openAIApiKey');
 | 
			
		||||
            const ollamaContextWindow = localStorage.getItem('ollamaContextWindow') || '2048';
 | 
			
		||||
 | 
			
		||||
            const res = await fetch(
 | 
			
		||||
              `${process.env.NEXT_PUBLIC_API_URL}/images`,
 | 
			
		||||
@@ -54,6 +54,9 @@ const SearchImages = ({
 | 
			
		||||
                      customOpenAIBaseURL: customOpenAIBaseURL,
 | 
			
		||||
                      customOpenAIKey: customOpenAIKey,
 | 
			
		||||
                    }),
 | 
			
		||||
                    ...(chatModelProvider === 'ollama' && {
 | 
			
		||||
                      ollamaContextWindow: parseInt(ollamaContextWindow),
 | 
			
		||||
                    }),
 | 
			
		||||
                  },
 | 
			
		||||
                }),
 | 
			
		||||
              },
 | 
			
		||||
 
 | 
			
		||||
@@ -48,9 +48,9 @@ const Searchvideos = ({
 | 
			
		||||
 | 
			
		||||
            const chatModelProvider = localStorage.getItem('chatModelProvider');
 | 
			
		||||
            const chatModel = localStorage.getItem('chatModel');
 | 
			
		||||
 | 
			
		||||
            const customOpenAIBaseURL = localStorage.getItem('openAIBaseURL');
 | 
			
		||||
            const customOpenAIKey = localStorage.getItem('openAIApiKey');
 | 
			
		||||
            const ollamaContextWindow = localStorage.getItem('ollamaContextWindow') || '2048';
 | 
			
		||||
 | 
			
		||||
            const res = await fetch(
 | 
			
		||||
              `${process.env.NEXT_PUBLIC_API_URL}/videos`,
 | 
			
		||||
@@ -69,6 +69,9 @@ const Searchvideos = ({
 | 
			
		||||
                      customOpenAIBaseURL: customOpenAIBaseURL,
 | 
			
		||||
                      customOpenAIKey: customOpenAIKey,
 | 
			
		||||
                    }),
 | 
			
		||||
                    ...(chatModelProvider === 'ollama' && {
 | 
			
		||||
                      ollamaContextWindow: parseInt(ollamaContextWindow),
 | 
			
		||||
                    }),
 | 
			
		||||
                  },
 | 
			
		||||
                }),
 | 
			
		||||
              },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user