Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmp #6295

Closed
wants to merge 1 commit into from
Closed

tmp #6295

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
})
Loading