Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jul 31, 2024
1 parent e8a62ab commit 5a89f4a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/langchain-google-common/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export abstract class ChatGoogleBase<AuthOptions>
): AsyncGenerator<ChatGenerationChunk> {
// Make the call as a streaming request
const parameters = this.invocationParams(options);
console.log("IN CHAT MODEL", this.model)
const response = await this.streamedConnection.request(
_messages,
parameters,
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain-google-common/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export abstract class GoogleConnection<
} else {
opts.responseType = "json";
}

console.dir(opts, { depth: null });
const callResponse = await this.caller.callWithOptions(
{ signal: options?.signal },
async () => this.client.request(opts)
Expand Down
2 changes: 2 additions & 0 deletions libs/langchain-google-common/src/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export abstract class GoogleBaseLLM<AuthOptions>
prompt: string,
options: this["ParsedCallOptions"]
): Promise<string> {
console.log("this.model", this.model)
const parameters = copyAIModelParams(this, options);
const result = await this.connection.request(prompt, parameters, options);
const ret = safeResponseToString(result, this.safetyHandler);
Expand Down Expand Up @@ -290,6 +291,7 @@ export abstract class GoogleBaseLLM<AuthOptions>
input: BaseLanguageModelInput,
options?: BaseLanguageModelCallOptions
): Promise<string> {
console.log("this.model", this.model)
const stream = await this._streamIterator(input, options);
let generatedOutput = "";
for await (const chunk of stream) {
Expand Down
9 changes: 9 additions & 0 deletions libs/langchain-google-vertexai/src/tests/llms.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,12 @@ describe("GAuth LLM gai", () => {
// console.log("res", res);
});
});

test.only("invoke", async () => {
const model = new VertexAI({
model: "gemini-1.5-pro",
});

const res = await model.invoke("1 + 1 = ");
console.log("res", res);
})

0 comments on commit 5a89f4a

Please sign in to comment.