CitizensFoundation / policy-synth

Policy Synth is a Typescript class library for creating multi-scale AI agent logic flows, API's and state of the art realtime web applications. The drive behind the project is to help governments and citizens make better decisions together by seamlessly integrating collective and artificial intelligence.
https://policy-synth.ai
MIT License
41 stars 5 forks source link

Convert AI Model classes constructors to take typedefed config objects #21

Closed rbjarnason closed 5 months ago

rbjarnason commented 5 months ago

Task Description We've created those constructor model options typedefs: interface PSModelConfig { apiKey: string; modelName?: string; maxTokensOut?: number; };

interface PSAzureModelConfig extends PSModelConfig { endpoint: string; deploymentName: string; };

interface PSOpenAiModelConfig extends PSModelConfig { projectId?: string; };

We need to change the underlying models but we can keep the base class the same do not change it.

Task Instructions

  1. Change src/models/clauseOpusChat.ts to use new options instead of function parameters and setup the rest of function in best possible way
  2. Change src/models/azureOpenAiChat.ts to use new options instead of function parameters and setup the rest of function in best possible way
  3. Change src/models/openAiChat.ts to use new options instead of function parameters and setup the rest of function in best possible way
  4. Change src/models/googleGeminiChat.ts to use new options instead of function parameters and setup the rest of function in best possible way