trustgraph-vertexai 1.4.12__tar.gz → 1.4.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of trustgraph-vertexai might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-vertexai
3
- Version: 1.4.12
3
+ Version: 1.4.13
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -152,29 +152,35 @@ class Processor(LlmService):
152
152
 
153
153
  return self.anthropic_client
154
154
 
155
- def _get_gemini_model(self, model_name):
155
+ def _get_gemini_model(self, model_name, temperature=None):
156
156
  """Get or create a Gemini model instance"""
157
157
  if model_name not in self.model_clients:
158
158
  logger.info(f"Creating GenerativeModel instance for '{model_name}'")
159
159
  self.model_clients[model_name] = GenerativeModel(model_name)
160
160
 
161
- # Create generation config for this model
162
- self.generation_configs[model_name] = GenerationConfig(
163
- temperature=self.temperature,
164
- top_p=1.0,
165
- top_k=10,
166
- candidate_count=1,
167
- max_output_tokens=self.max_output,
168
- )
161
+ # Use provided temperature or fall back to default
162
+ effective_temperature = temperature if temperature is not None else self.temperature
163
+
164
+ # Create generation config with the effective temperature
165
+ generation_config = GenerationConfig(
166
+ temperature=effective_temperature,
167
+ top_p=1.0,
168
+ top_k=10,
169
+ candidate_count=1,
170
+ max_output_tokens=self.max_output,
171
+ )
169
172
 
170
- return self.model_clients[model_name], self.generation_configs[model_name]
173
+ return self.model_clients[model_name], generation_config
171
174
 
172
- async def generate_content(self, system, prompt, model=None):
175
+ async def generate_content(self, system, prompt, model=None, temperature=None):
173
176
 
174
177
  # Use provided model or fall back to default
175
178
  model_name = model or self.default_model
179
+ # Use provided temperature or fall back to default
180
+ effective_temperature = temperature if temperature is not None else self.temperature
176
181
 
177
182
  logger.debug(f"Using model: {model_name}")
183
+ logger.debug(f"Using temperature: {effective_temperature}")
178
184
 
179
185
  try:
180
186
  if 'claude' in model_name.lower():
@@ -187,7 +193,7 @@ class Processor(LlmService):
187
193
  system=system,
188
194
  messages=[{"role": "user", "content": prompt}],
189
195
  max_tokens=self.api_params['max_output_tokens'],
190
- temperature=self.api_params['temperature'],
196
+ temperature=effective_temperature,
191
197
  top_p=self.api_params['top_p'],
192
198
  top_k=self.api_params['top_k'],
193
199
  )
@@ -203,7 +209,7 @@ class Processor(LlmService):
203
209
  logger.debug(f"Sending request to Gemini model '{model_name}'...")
204
210
  full_prompt = system + "\n\n" + prompt
205
211
 
206
- llm, generation_config = self._get_gemini_model(model_name)
212
+ llm, generation_config = self._get_gemini_model(model_name, effective_temperature)
207
213
 
208
214
  response = llm.generate_content(
209
215
  full_prompt, generation_config = generation_config,
@@ -0,0 +1 @@
1
+ __version__ = "1.4.13"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-vertexai
3
- Version: 1.4.12
3
+ Version: 1.4.13
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -1 +0,0 @@
1
- __version__ = "1.4.12"