MCPcopy Create free account

hub / github.com/GoogleCloudPlatform/golang-samples / functions

Functions5,023 in github.com/GoogleCloudPlatform/golang-samples

↓ 1 callersFunctionfindNearestDistanceDataExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:2068
↓ 1 callersFunctionfindNearestDistanceExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:2087
↓ 1 callersFunctionfindNearestLimitExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:2052
↓ 1 callersFunctionfindNearestSyntaxExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:2036
↓ 1 callersFunctionfindRegionTags
(pkgs <-chan string)
regiontag_test.go:55
↓ 1 callersFunctionfloat32Ptr
(v float32)
genai/bounding_box/boundingbox_with_txt_img.go:162
↓ 1 callersFunctionfloorFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_arithmetic.go:142
↓ 1 callersFunctionfoo1
()
profiler/hotmid/main.go:76
↓ 1 callersFunctionfoo1
(scale int)
profiler/hotapp/main.go:112
↓ 1 callersFunctionfoo2
()
profiler/hotmid/main.go:80
↓ 1 callersFunctionfoo2
(scale int)
profiler/hotapp/main.go:121
↓ 1 callersFunctionfoo3
()
profiler/hotmid/main.go:84
↓ 1 callersFunctionfoo4
()
profiler/hotmid/main.go:88
↓ 1 callersFunctionfoo5
()
profiler/hotmid/main.go:92
↓ 1 callersFunctionfoo6
()
profiler/hotmid/main.go:96
↓ 1 callersFunctionforceIndexExamples
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:1494
↓ 1 callersFunctionformatMargin
formatMargin calculates the difference between votes and returns a human friendly margin (e.g., 2 votes)
cloudsql/sqlserver/database-sql/cloudsql.go:90
↓ 1 callersFunctionformatMargin
formatMargin calculates the difference between votes and returns a human friendly margin (e.g., 2 votes)
cloudsql/postgres/database-sql/cloudsql.go:86
↓ 1 callersFunctionformatMargin
formatMargin calculates the difference between votes and returns a human friendly margin (e.g., 2 votes)
cloudsql/mysql/database-sql/cloudsql.go:86
↓ 1 callersFunctionformatTokens
(tokens [][]byte)
genai/count_tokens/counttoken_localtokenizer_compute_with_txt.go:61
↓ 1 callersFunctionfunctionCalling
functionCalling demonstrates how to submit a prompt and a function declaration to the model, allowing it to suggest a call to the function to fetch ex
vertexai/function-calling/functioncalling_basic.go:33
↓ 1 callersFunctionfunctionCallsChat
functionCallsChat opens a chat session and sends 4 messages to the model: - convert a first text question into a structured function call request - co
vertexai/function-calling/functioncalling.go:42
↓ 1 callersFunctionfunctionsExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_array.go:234
↓ 1 callersFunctiongeminiTranslate
geminiTranslate shows how translate text, using gemini
vertexai/snippets/gemini_translate.go:29
↓ 1 callersFunctiongenerateAudioTranscript
generateAudioTranscript shows how to generate an audio transcript.
genai/text_generation/textgen_transcript_with_gcs_audio.go:28
↓ 1 callersFunctiongenerateBatchEmbeddingsMock
(w io.Writer, outputURI string)
genai/batch_prediction/batchprediction_examples_test.go:60
↓ 1 callersFunctiongenerateBatchPredictMock
(w io.Writer, outputURI string)
genai/batch_prediction/batchprediction_examples_test.go:143
↓ 1 callersFunctiongenerateBatchPredictWithBQMock
(w io.Writer, outputURI string)
genai/batch_prediction/batchprediction_examples_test.go:232
↓ 1 callersFunctiongenerateBoundingBoxesWithText
(w io.Writer)
genai/bounding_box/boundingbox_with_txt_img.go:81
↓ 1 callersFunctiongenerateChatStreamWithText
generateChatStreamWithText shows how to generate chat stream using a text prompt.
genai/text_generation/textgen_with_chat_stream.go:28
↓ 1 callersFunctiongenerateChatWithText
generateChatWithText shows how to generate chat using a text prompt.
genai/text_generation/textgen_chat_with_txt.go:28
↓ 1 callersFunctiongenerateContent
(w io.Writer, projectID, modelName string)
vertexai/stream-multimodality-basic/streammultimodalitybasic.go:28
↓ 1 callersFunctiongenerateContent
generateContent shows how to send a basic streaming text prompt, writing the response to the provided io.Writer.
vertexai/stream-text-basic/streamtextbasic.go:30
↓ 1 callersFunctiongenerateContent
generateContent generates text from prompt and configurations provided.
vertexai/safety-settings/safety-settings.go:27
↓ 1 callersFunctiongenerateContentFromText
(w io.Writer, projectID string)
vertexai/snippets/text_input.go:26
↓ 1 callersFunctiongenerateContentWithThoughts
generateContentWithThoughts demonstrates how to generate text including the model's thought process.
genai/thinking/thinkgen_include_thoughts_with_txt.go:28
↓ 1 callersFunctiongenerateContentWithTxt
generateContentWithTxt demonstrates how to generate text with thinking model.
genai/thinking/thinking_with_txt.go:28
↓ 1 callersFunctiongenerateEmbedContentWithText
generateEmbedContentWithText shows how to embed content with text.
genai/embeddings/embeddings_docretrieval_with_txt.go:28
↓ 1 callersFunctiongenerateEncryptionKey
generateEncryptionKey generates a 256 bit (32 byte) AES encryption key and prints the base64 representation.
storage/objects/generate_encryption_key.go:27
↓ 1 callersFunctiongenerateExampleDefaultMessages
generateExampleMessages generates a slice of serialized protobuf messages using a statically defined and compiled protocol buffer file, and returns th
bigquery/snippets/managedwriter/bigquerystorage_append_rows_default.go:34
↓ 1 callersFunctiongenerateForImageTextAndVideo
generateForImageTextAndVideo shows how to use the multimodal model to generate embeddings for image, text and video data.
vertexai/embeddings/generate_for_image_text_and_video.go:35
↓ 1 callersFunctiongenerateForTextAndImage
generateForTextAndImage shows how to use the multimodal model to generate embeddings for text and image inputs.
vertexai/embeddings/generate_for_image_and_text.go:34
↓ 1 callersFunctiongenerateForVideo
generateForVideo shows how to use the multimodal model to generate embeddings for video input.
vertexai/embeddings/generate_for_video.go:34
↓ 1 callersFunctiongenerateGoogleMapsCoordinatesWithText
generateGoogleMapsCoordinatesWithText demonstrates using the Google Maps tool to get responses localized to specific coordinates.
genai/tools/tools_google_maps_coordinates_with_txt.go:29
↓ 1 callersFunctiongenerateGoogleSearchURLContextWithText
generateGoogleSearchURLContextWithText demonstrates using both the Google Search Tool and the URL Context Tool with Gemini.
genai/tools/tools_google_search_and_urlcontext_with_txt.go:29
↓ 1 callersFunctiongenerateGroundSearchWithTxt
generateGroundSearchWithTxt demonstrates using a live Gemini model with Google Search grounded responses.
genai/live/live_ground_googsearch_with_txt.go:28
↓ 1 callersFunctiongenerateImageMMFlashEditWithTextImg
generateImageMMFlashEditWithTextImg demonstrates editing an image with text and image inputs.
genai/image_generation/imggen_mmflash_edit_img_with_txt_img.go:29
↓ 1 callersFunctiongenerateImageWithText
generateImageWithText demonstrates how to generate an image from a text prompt.
genai/image_generation/imggen_with_txt.go:29
↓ 1 callersFunctiongenerateImgVirtualTryOnWithTextImg
generateImgVirtualTryOnWithTextImg demonstrates how to apply a product image to a person image.
genai/image_generation/imggen_virtual_try_on_with_txt_img.go:30
↓ 1 callersFunctiongenerateJWT
[START endpoints_generate_jwt_sa] generateJWT creates a signed JSON Web Token using a Google API Service Account.
endpoints/getting-started/client/main.go:63
↓ 1 callersFunctiongenerateLiveAudioConversationMock
Mock version of generateLiveAudioConversation
genai/live/live_examples_test.go:67
↓ 1 callersFunctiongenerateLiveAudioWithTextMock
(w io.Writer)
genai/live/live_examples_test.go:97
↓ 1 callersFunctiongenerateLiveCodeExecMock
(w io.Writer)
genai/live/live_examples_test.go:74
↓ 1 callersFunctiongenerateLiveFuncCallWithTxtMock
(w io.Writer)
genai/live/live_examples_test.go:27
↓ 1 callersFunctiongenerateLiveRAGWithTextMock
(w io.Writer, memoryCorpus string)
genai/live/live_examples_test.go:52
↓ 1 callersFunctiongenerateLiveTextWithAudioMock
Mock function simulating generateLiveTextWithAudio without API/WebSocket.
genai/live/live_examples_test.go:59
↓ 1 callersFunctiongenerateLiveTranscribeWithAudioMock
(w io.Writer)
genai/live/live_examples_test.go:80
↓ 1 callersFunctiongenerateLiveWithTextMock
(w io.Writer)
genai/live/live_examples_test.go:90
↓ 1 callersFunctiongenerateMMFlashLocaleAwareWithText
generateMMFlashLocaleAwareWithText demonstrates how to generate an image with locale awareness.
genai/image_generation/imggen_mmflash_locale_aware_with_txt.go:30
↓ 1 callersFunctiongenerateMMFlashMultipleImgsWithText
generateMMFlashMultipleImgsWithText demonstrates how to generate multiple images with text.
genai/image_generation/imggen_mmflash_multiple_imgs_with_txt.go:30
↓ 1 callersFunctiongenerateMMFlashTxtImgWithText
generateMMFlashTxtImgWithText demonstrates how to generate an illustrated recipe combining text and image outputs into a markdown file.
genai/image_generation/imggen_mmflash_txt_img_with_txt.go:31
↓ 1 callersFunctiongenerateMMFlashWithText
generateMMFlashWithText demonstrates how to generate both text and image outputs.
genai/image_generation/imggen_mmflash_with_txt.go:29
↓ 1 callersFunctiongenerateModel
generateModel creates an example BigQuery ML model.
bigquery/snippets/job/integration_test.go:226
↓ 1 callersFunctiongenerateModelOptimizerWithTxt
generateModelOptimizerWithTxt shows how to generate text using a text prompt and model optimizer.
genai/text_generation/textgen_model_optimizer_with_txt.go:28
↓ 1 callersFunctiongenerateMultimodalContent
generateMultimodalContent shows how to send video and text prompts to a model, writing the response to the provided io.Writer.
vertexai/multimodal-video-with-audio/multimodalvideoaudio.go:32
↓ 1 callersFunctiongenerateRandomBytes
generateRandomBytes generates random bytes with entropy sourced from the given location.
kms/generate_random_bytes.go:30
↓ 1 callersFunctiongenerateSignedPostPolicyV4
generateSignedPostPolicyV4 generates a signed post policy.
storage/objects/generate_signed_post_policy_v4.go:41
↓ 1 callersFunctiongenerateStructuredOutputWithTxtMock
(w io.Writer)
genai/live/live_examples_test.go:33
↓ 1 callersFunctiongenerateText
generateText shows how to generate text Provisioned Throughput.
genai/provisioned_throughput/provisionedthroughput_with_txt.go:29
↓ 1 callersFunctiongenerateTextAndCount
generateTextAndCount shows how to generate text and obtain token count metadata from the model response.
genai/count_tokens/counttoken_resp_with_txt.go:29
↓ 1 callersFunctiongenerateTextWithPDF
generateTextWithPDF shows how to generate text using a PDF file input.
genai/text_generation/textgen_with_pdf.go:28
↓ 1 callersFunctiongenerateTextWithSafety
generateTextWithSafety shows how to apply safety settings to a text generation request.
genai/safety/safety_with_txt.go:28
↓ 1 callersFunctiongenerateThinkingBudgetContentWithText
generateThinkingBudgetContentWithText demonstrates how to generate text including the model's thought process.
genai/thinking/thinking_budget_with_txt.go:28
↓ 1 callersFunctiongenerateThinkingWithText
generateThinkingWithText shows how to generate thinking using a text prompt.
genai/text_generation/textgen_thinking_with_txt.go:28
↓ 1 callersFunctiongenerateURLContentWithText
generateURLContentWithText demonstrates using the URL Context tool to compare and reason over the content of external URLs.
genai/tools/tools_urlcontext_with_txt.go:29
↓ 1 callersFunctiongenerateV4GetObjectSignedURL
generateV4GetObjectSignedURL generates object signed URL with GET method.
storage/objects/generate_v4_get_object_signed_url.go:28
↓ 1 callersFunctiongenerateV4PutObjectSignedURL
generateV4PutObjectSignedURL generates object signed URL with PUT method.
storage/objects/generate_v4_put_object_signed_url.go:28
↓ 1 callersFunctiongenerateVideoFromImageMock
(w io.Writer, outputGCSURI string)
genai/video_generation/video_generation_examples_test.go:70
↓ 1 callersFunctiongenerateVideoWithTextMock
(w io.Writer, outputGCSURI string)
genai/video_generation/video_generation_examples_test.go:155
↓ 1 callersFunctiongenerateWithAudio
generateWithAudio shows how to generate text using an audio input.
genai/text_generation/textgen_with_gcs_audio.go:28
↓ 1 callersFunctiongenerateWithClassSchema
generateWithClassSchema shows how to use class schema to generate output.
genai/controlled_generation/ctrlgen_with_class_schema.go:35
↓ 1 callersFunctiongenerateWithCodeExec
generateWithCodeExec shows how to generate text using the code execution tool.
genai/tools/tools_code_exec_with_txt.go:28
↓ 1 callersFunctiongenerateWithConfig
generateWithConfig shows how to generate text using a text prompt and custom configuration.
genai/text_generation/textgen_config_with_txt.go:28
↓ 1 callersFunctiongenerateWithEnumClassSchema
generateWithEnumClassSchema shows how to use a class-like enum schema to generate output.
genai/controlled_generation/ctrlgen_with_enum_class_schema.go:44
↓ 1 callersFunctiongenerateWithEnumSchema
generateWithEnumSchema shows how to use enum schema to generate output.
genai/controlled_generation/ctrlgen_with_enum_schema.go:28
↓ 1 callersFunctiongenerateWithFuncCall
generateWithFuncCall shows how to submit a prompt and a function declaration to the model, allowing it to suggest a call to the function to fetch exte
genai/tools/tools_func_desc_with_txt.go:30
↓ 1 callersFunctiongenerateWithGoogleSearch
generateWithGoogleSearch shows how to generate text using Google Search.
genai/tools/tools_google_search_with_txt.go:28
↓ 1 callersFunctiongenerateWithGoogleVAISMock
(w io.Writer, dataStore string)
genai/tools/tools_examples_test.go:43
↓ 1 callersFunctiongenerateWithLocalImgAndCodeExec
generateWithLocalImgAndCodeExec shows how to combine a local image, a text prompt, and enable the code execution tool in a request.
genai/tools/tools_code_exec_with_txt_local_img.go:30
↓ 1 callersFunctiongenerateWithLocalVideo
generateWithLocalVideo shows how to generate text using a local video input.
genai/text_generation/textgen_with_local_video.go:29
↓ 1 callersFunctiongenerateWithLowerDimension
generateWithLowerDimension shows how to generate lower-dimensional embeddings for text and image inputs.
vertexai/embeddings/generate_with_lower_dimension.go:33
↓ 1 callersFunctiongenerateWithMultiLocalImages
generateWithMultiLocalImages shows how to generate text using multiple local image inputs.
genai/text_generation/textgen_with_multi_local_img.go:29
↓ 1 callersFunctiongenerateWithMuteVideo
generateWithMuteVideo shows how to generate text using a video with no sound as the input.
genai/text_generation/textgen_with_mute_video.go:28
↓ 1 callersFunctiongenerateWithNestedClassSchema
generateWithNestedClassSchema shows how to use nested class schema to generate output.
genai/controlled_generation/ctrlgen_with_nested_class_schema.go:44
↓ 1 callersFunctiongenerateWithNullables
generateWithNullables shows how to use the response schema with nullable values.
genai/controlled_generation/ctrlgen_with_nullable_schema.go:28
↓ 1 callersFunctiongenerateWithPDF
generateWithPDF shows how to generate code using a PDF file input.
genai/text_generation/textgen_code_with_pdf.go:28
↓ 1 callersFunctiongenerateWithRespSchema
generateWithRespSchema shows how to use a response schema to generate output in a specific format.
genai/controlled_generation/ctrlgen_with_resp_schema.go:28
↓ 1 callersFunctiongenerateWithRouting
generateWithRouting shows how to generate text using a text prompt and routing configuration.
genai/text_generation/textgen_with_routing.go:28
↓ 1 callersFunctiongenerateWithSystem
generateWithSystem shows how to generate text using a text prompt and system instruction.
genai/text_generation/textgen_sys_instr_with_txt.go:28
↓ 1 callersFunctiongenerateWithText
generateWithText shows how to generate text using a text prompt.
genai/text_generation/textgen_with_txt.go:28
← previousnext →1,601–1,700 of 5,023, ranked by callers